All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 00/24] accel/tcg: Widen TranslationBlock::flags to 64 bits
@ 2026-11-26 23:35 Philippe Mathieu-Daudé
  2026-11-26 23:35 ` [PATCH 01/24] target/arm: Widen CPUARMTBFlags::flags " Philippe Mathieu-Daudé
                   ` (23 more replies)
  0 siblings, 24 replies; 102+ messages in thread
From: Philippe Mathieu-Daudé @ 2026-11-26 23:35 UTC (permalink / raw)
  To: qemu-devel
  Cc: Richard Henderson, qemu-riscv, qemu-s390x, qemu-arm, qemu-ppc,
	Anton Johansson, Pierrick Bouvier, Philippe Mathieu-Daudé

Wanting to support another MIPS ISA I realized all the target
flags are occupied. When that happen we use @cs_base as extra
jocker, but then I remembered we aren't restricted to 32-bits
anymore and can convert TranslationBlock::flags to uint64.
Hence this series. Doing so I noticed RISCV MISA handling
could be a bit simplified using full cs_base jocker card.
Notes taken while auditing uses also committed.

Philippe Mathieu-Daudé (24):
  target/arm: Widen CPUARMTBFlags::flags to 64 bits
  accel/tcg: Update stale TranslationBlock::jmp_lock comment
  accel/tcg: Widen TranslationBlock::flags to 64 bits
  target/arm: Update TB flags split comment for 64-bit tb->flags
  target/alpha: Use 64-bit TB flags
  target/avr: Use 64-bit TB flags
  target/hexagon: Use 64-bit TB flags
  target/hppa: Use 64-bit TB flags
  target/i386: Use 64-bit TB flags
  target/loongarch: Use 64-bit TB flags
  target/m68k: Use 64-bit TB flags
  target/microblaze: Use 64-bit TB flags
  target/mips: Use 64-bit TB flags
  target/or1k: Use 64-bit TB flags
  target/ppc: Use 64-bit TB flags
  target/riscv: Use 64-bit TB flags
  target/riscv: Partially revert use of tb->cs_base
  target/rx: Use 64-bit TB flags
  target/s390x: Use 64-bit TB flags
  target/sh4: Use 64-bit TB flags
  target/sparc: Use 64-bit TB flags
  target/tricore: Use 64-bit TB flags
  target/xtensa: Use 64-bit TB flags
  accel/tcg: Update TranslationBlock::cs_base description

 accel/tcg/tb-hash.h              |  5 +--
 include/accel/tcg/tb-cpu-state.h |  2 +-
 include/exec/translation-block.h | 23 +++++++++----
 target/arm/cpu.h                 | 17 +++++-----
 target/riscv/cpu.h               |  8 ++---
 target/sparc/cpu.h               |  4 +--
 accel/tcg/cpu-exec.c             |  2 +-
 target/alpha/cpu.c               |  2 +-
 target/alpha/translate.c         |  2 +-
 target/arm/tcg/hflags.c          |  4 +--
 target/avr/cpu.c                 |  2 +-
 target/avr/translate.c           |  2 +-
 target/hexagon/cpu.c             | 16 ++++-----
 target/hexagon/translate.c       | 14 ++++----
 target/hppa/cpu.c                |  2 +-
 target/hppa/translate.c          |  2 +-
 target/i386/tcg/tcg-cpu.c        |  3 +-
 target/i386/tcg/translate.c      |  4 +--
 target/loongarch/tcg/tcg_cpu.c   |  2 +-
 target/m68k/cpu.c                |  2 +-
 target/microblaze/translate.c    |  6 ++--
 target/mips/cpu.c                |  2 +-
 target/mips/tcg/translate.c      |  2 +-
 target/or1k/translate.c          |  2 +-
 target/ppc/translate.c           |  2 +-
 target/riscv/tcg/tcg-cpu.c       | 58 +++++++++++++++-----------------
 target/riscv/tcg/translate.c     | 49 +++++++++++++--------------
 target/rx/cpu.c                  |  6 ++--
 target/rx/translate.c            | 16 ++++-----
 target/s390x/cpu.c               |  2 +-
 target/sh4/cpu.c                 |  2 +-
 target/sh4/translate.c           |  4 +--
 target/sparc/cpu.c               |  4 +--
 target/tricore/cpu.c             |  2 +-
 target/tricore/translate.c       |  4 +--
 target/xtensa/cpu.c              |  2 +-
 target/xtensa/translate.c        |  2 +-
 37 files changed, 146 insertions(+), 137 deletions(-)

-- 
2.55.0



^ permalink raw reply	[flat|nested] 102+ messages in thread

* [PATCH 01/24] target/arm: Widen CPUARMTBFlags::flags to 64 bits
  2026-11-26 23:35 [PATCH 00/24] accel/tcg: Widen TranslationBlock::flags to 64 bits Philippe Mathieu-Daudé
@ 2026-11-26 23:35 ` Philippe Mathieu-Daudé
  2026-11-27  9:58     ` Anton Johansson via
  2026-11-26 23:35 ` [PATCH 02/24] accel/tcg: Update stale TranslationBlock::jmp_lock comment Philippe Mathieu-Daudé
                   ` (22 subsequent siblings)
  23 siblings, 1 reply; 102+ messages in thread
From: Philippe Mathieu-Daudé @ 2026-11-26 23:35 UTC (permalink / raw)
  To: qemu-devel
  Cc: Richard Henderson, qemu-riscv, qemu-s390x, qemu-arm, qemu-ppc,
	Anton Johansson, Pierrick Bouvier, Philippe Mathieu-Daudé,
	Peter Maydell

Use the 64-bit field accessors for TBFLAG_ANY and print the value
with PRIx64. Prepare for TranslationBlock::flags becoming 64-bit.

Signed-off-by: Philippe Mathieu-Daudé <philmd@oss.qualcomm.com>
---
 target/arm/cpu.h        | 12 ++++++------
 target/arm/tcg/hflags.c |  4 ++--
 2 files changed, 8 insertions(+), 8 deletions(-)

diff --git a/target/arm/cpu.h b/target/arm/cpu.h
index b2f393f50184..5ee9ebf352fb 100644
--- a/target/arm/cpu.h
+++ b/target/arm/cpu.h
@@ -150,7 +150,7 @@ typedef struct ARMPACKey {
 
 /* See the commentary above the TBFLAG field definitions.  */
 typedef struct CPUARMTBFlags {
-    uint32_t flags;
+    uint64_t flags;
     uint64_t flags2;
 } CPUARMTBFlags;
 
@@ -2614,12 +2614,12 @@ FIELD(TBFLAG_A64, MTE0_STORE_ONLY, 48, 1)
 FIELD(TBFLAG_A64, MTX, 49, 2)
 
 /*
- * Helpers for using the above. Note that only the A64 accessors use
- * FIELD_DP64() and FIELD_EX64(), because in the other cases the flags
- * word either is or might be 32 bits only.
+ * Helpers for using the above. Note that only the ANY and A64 accessors
+ * use FIELD_DP64() and FIELD_EX64(), because the A32, M32 and AM32
+ * fields all fit in 32 bits.
  */
 #define DP_TBFLAG_ANY(DST, WHICH, VAL) \
-    ((DST).flags = FIELD_DP32((DST).flags, TBFLAG_ANY, WHICH, VAL))
+    ((DST).flags = FIELD_DP64((DST).flags, TBFLAG_ANY, WHICH, VAL))
 #define DP_TBFLAG_A64(DST, WHICH, VAL) \
     ((DST).flags2 = FIELD_DP64((DST).flags2, TBFLAG_A64, WHICH, VAL))
 #define DP_TBFLAG_A32(DST, WHICH, VAL) \
@@ -2629,7 +2629,7 @@ FIELD(TBFLAG_A64, MTX, 49, 2)
 #define DP_TBFLAG_AM32(DST, WHICH, VAL) \
     ((DST).flags2 = FIELD_DP32((DST).flags2, TBFLAG_AM32, WHICH, VAL))
 
-#define EX_TBFLAG_ANY(IN, WHICH)   FIELD_EX32((IN).flags, TBFLAG_ANY, WHICH)
+#define EX_TBFLAG_ANY(IN, WHICH)   FIELD_EX64((IN).flags, TBFLAG_ANY, WHICH)
 #define EX_TBFLAG_A64(IN, WHICH)   FIELD_EX64((IN).flags2, TBFLAG_A64, WHICH)
 #define EX_TBFLAG_A32(IN, WHICH)   FIELD_EX32((IN).flags2, TBFLAG_A32, WHICH)
 #define EX_TBFLAG_M32(IN, WHICH)   FIELD_EX32((IN).flags2, TBFLAG_M32, WHICH)
diff --git a/target/arm/tcg/hflags.c b/target/arm/tcg/hflags.c
index c0b47f484e65..7dbc5759d718 100644
--- a/target/arm/tcg/hflags.c
+++ b/target/arm/tcg/hflags.c
@@ -753,8 +753,8 @@ static void assert_hflags_rebuild_correctly(CPUARMState *env)
 
     if (unlikely(c.flags != r.flags || c.flags2 != r.flags2)) {
         fprintf(stderr, "TCG hflags mismatch "
-                        "(current:(0x%08x,0x%016" PRIx64 ")"
-                        " rebuilt:(0x%08x,0x%016" PRIx64 ")\n",
+                        "(current:(0x%016" PRIx64 ",0x%016" PRIx64 ")"
+                        " rebuilt:(0x%016" PRIx64 ",0x%016" PRIx64 ")\n",
                 c.flags, c.flags2, r.flags, r.flags2);
         abort();
     }
-- 
2.55.0



^ permalink raw reply related	[flat|nested] 102+ messages in thread

* [PATCH 02/24] accel/tcg: Update stale TranslationBlock::jmp_lock comment
  2026-11-26 23:35 [PATCH 00/24] accel/tcg: Widen TranslationBlock::flags to 64 bits Philippe Mathieu-Daudé
  2026-11-26 23:35 ` [PATCH 01/24] target/arm: Widen CPUARMTBFlags::flags " Philippe Mathieu-Daudé
@ 2026-11-26 23:35 ` Philippe Mathieu-Daudé
  2026-11-27  9:59     ` Anton Johansson via
  2026-11-26 23:35 ` [PATCH 03/24] accel/tcg: Widen TranslationBlock::flags to 64 bits Philippe Mathieu-Daudé
                   ` (21 subsequent siblings)
  23 siblings, 1 reply; 102+ messages in thread
From: Philippe Mathieu-Daudé @ 2026-11-26 23:35 UTC (permalink / raw)
  To: qemu-devel
  Cc: Richard Henderson, qemu-riscv, qemu-s390x, qemu-arm, qemu-ppc,
	Anton Johansson, Pierrick Bouvier, Philippe Mathieu-Daudé

jmp_lock was placed to fill a 4-byte hole, but commit 9da6079b2695
("tcg: Add TranslationBlock.jmp_insn_offset") added jmp_insn_offset[],
so jmp_lock, jmp_reset_offset[] and jmp_insn_offset[] now take 12
bytes, leaving a 4-byte hole after jmp_insn_offset.

Signed-off-by: Philippe Mathieu-Daudé <philmd@oss.qualcomm.com>
---
 include/exec/translation-block.h | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/include/exec/translation-block.h b/include/exec/translation-block.h
index 5a7a638b087f..f61e8e4ec0b9 100644
--- a/include/exec/translation-block.h
+++ b/include/exec/translation-block.h
@@ -113,7 +113,11 @@ struct TranslationBlock {
     tb_page_addr_t page_addr[2];
 #endif
 
-    /* jmp_lock placed here to fill a 4-byte hole. Its documentation is below */
+    /*
+     * jmp_lock, jmp_reset_offset[] and jmp_insn_offset[] take 12 bytes,
+     * leaving a 4-byte hole before jmp_target_addr[].
+     * jmp_lock documentation is below.
+     */
     QemuSpin jmp_lock;
 
     /* The following data are used to directly call another TB from
-- 
2.55.0



^ permalink raw reply related	[flat|nested] 102+ messages in thread

* [PATCH 03/24] accel/tcg: Widen TranslationBlock::flags to 64 bits
  2026-11-26 23:35 [PATCH 00/24] accel/tcg: Widen TranslationBlock::flags to 64 bits Philippe Mathieu-Daudé
  2026-11-26 23:35 ` [PATCH 01/24] target/arm: Widen CPUARMTBFlags::flags " Philippe Mathieu-Daudé
  2026-11-26 23:35 ` [PATCH 02/24] accel/tcg: Update stale TranslationBlock::jmp_lock comment Philippe Mathieu-Daudé
@ 2026-11-26 23:35 ` Philippe Mathieu-Daudé
  2026-11-27 11:03     ` Anton Johansson via
  2026-11-26 23:35 ` [PATCH 04/24] target/arm: Update TB flags split comment for 64-bit tb->flags Philippe Mathieu-Daudé
                   ` (20 subsequent siblings)
  23 siblings, 1 reply; 102+ messages in thread
From: Philippe Mathieu-Daudé @ 2026-11-26 23:35 UTC (permalink / raw)
  To: qemu-devel
  Cc: Richard Henderson, qemu-riscv, qemu-s390x, qemu-arm, qemu-ppc,
	Anton Johansson, Pierrick Bouvier, Philippe Mathieu-Daudé,
	Paolo Bonzini

32-bit host support was removed in v11.0.0 (with commit 372ec46b9f
"meson: Reject 32-bit hosts"), so there is no reason to keep the TB
flags 32-bit. The wider field fills the 4-byte hole between icount
and tc, leaving sizeof(TranslationBlock) unchanged. Widen
TCGTBCPUState::flags too.

Feed the upper 32 bits into the TB hash, and adapt format string.

Signed-off-by: Philippe Mathieu-Daudé <philmd@oss.qualcomm.com>
---
 accel/tcg/tb-hash.h              | 5 +++--
 include/accel/tcg/tb-cpu-state.h | 2 +-
 include/exec/translation-block.h | 2 +-
 accel/tcg/cpu-exec.c             | 2 +-
 4 files changed, 6 insertions(+), 5 deletions(-)

diff --git a/accel/tcg/tb-hash.h b/accel/tcg/tb-hash.h
index f7b159f04cb6..819b594618aa 100644
--- a/accel/tcg/tb-hash.h
+++ b/accel/tcg/tb-hash.h
@@ -63,9 +63,10 @@ static inline unsigned int tb_jmp_cache_hash_func(vaddr pc)
 
 static inline
 uint32_t tb_hash_func(tb_page_addr_t phys_pc, vaddr pc,
-                      uint32_t flags, uint64_t flags2, uint32_t cf_mask)
+                      uint64_t flags, uint64_t flags2, uint32_t cf_mask)
 {
-    return qemu_xxhash8(phys_pc, pc, flags2, flags, cf_mask);
+    /* Fold the upper flag bits into the cf_mask slot. */
+    return qemu_xxhash8(phys_pc, pc, flags2, flags, cf_mask ^ (flags >> 32));
 }
 
 #endif
diff --git a/include/accel/tcg/tb-cpu-state.h b/include/accel/tcg/tb-cpu-state.h
index 1903af4c2a29..07195df020a4 100644
--- a/include/accel/tcg/tb-cpu-state.h
+++ b/include/accel/tcg/tb-cpu-state.h
@@ -14,7 +14,7 @@
 
 typedef struct TCGTBCPUState {
     vaddr pc;
-    uint32_t flags;
+    uint64_t flags;
     uint32_t cflags;
     uint64_t cs_base;
 } TCGTBCPUState;
diff --git a/include/exec/translation-block.h b/include/exec/translation-block.h
index f61e8e4ec0b9..f9f4876e6dd3 100644
--- a/include/exec/translation-block.h
+++ b/include/exec/translation-block.h
@@ -69,7 +69,7 @@ struct TranslationBlock {
      */
     uint64_t cs_base;
 
-    uint32_t flags; /* flags defining in which context the code was generated */
+    uint64_t flags; /* flags defining in which context the code was generated */
     uint32_t cflags;    /* compile flags */
 
 /* Note that TCG_MAX_INSNS is 512; we validate this match elsewhere. */
diff --git a/accel/tcg/cpu-exec.c b/accel/tcg/cpu-exec.c
index 449770148663..cba4e634f616 100644
--- a/accel/tcg/cpu-exec.c
+++ b/accel/tcg/cpu-exec.c
@@ -271,7 +271,7 @@ static void log_cpu_exec(vaddr pc, CPUState *cpu,
     if (qemu_log_in_addr_range(pc)) {
         qemu_log_mask(CPU_LOG_EXEC,
                       "Trace %d: %p [%08" PRIx64
-                      "/%016" VADDR_PRIx "/%08x/%08x] %s\n",
+                      "/%016" VADDR_PRIx "/%08" PRIx64 "/%08x] %s\n",
                       cpu->cpu_index, tb->tc.ptr, tb->cs_base, pc,
                       tb->flags, tb->cflags, lookup_symbol(pc));
 
-- 
2.55.0



^ permalink raw reply related	[flat|nested] 102+ messages in thread

* [PATCH 04/24] target/arm: Update TB flags split comment for 64-bit tb->flags
  2026-11-26 23:35 [PATCH 00/24] accel/tcg: Widen TranslationBlock::flags to 64 bits Philippe Mathieu-Daudé
                   ` (2 preceding siblings ...)
  2026-11-26 23:35 ` [PATCH 03/24] accel/tcg: Widen TranslationBlock::flags to 64 bits Philippe Mathieu-Daudé
@ 2026-11-26 23:35 ` Philippe Mathieu-Daudé
  2026-11-27 11:09     ` Anton Johansson via
  2026-11-26 23:35 ` [PATCH 05/24] target/alpha: Use 64-bit TB flags Philippe Mathieu-Daudé
                   ` (19 subsequent siblings)
  23 siblings, 1 reply; 102+ messages in thread
From: Philippe Mathieu-Daudé @ 2026-11-26 23:35 UTC (permalink / raw)
  To: qemu-devel
  Cc: Richard Henderson, qemu-riscv, qemu-s390x, qemu-arm, qemu-ppc,
	Anton Johansson, Pierrick Bouvier, Philippe Mathieu-Daudé,
	Peter Maydell

TranslationBlock::flags is now 64-bit, but AArch64 needs
TBFLAG_ANY (15 bits) plus TBFLAG_A64 (51 bits), so the split
with tb->cs_base is still required.

Signed-off-by: Philippe Mathieu-Daudé <philmd@oss.qualcomm.com>
---
 target/arm/cpu.h | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/target/arm/cpu.h b/target/arm/cpu.h
index 5ee9ebf352fb..59e44b76a08a 100644
--- a/target/arm/cpu.h
+++ b/target/arm/cpu.h
@@ -2484,8 +2484,9 @@ static inline bool arm_sctlr_b(const CPUARMState *env)
 uint64_t arm_sctlr(CPUARMState *env, int el);
 
 /*
- * We have more than 32-bits worth of state per TB, so we split the data
- * between tb->flags and tb->cs_base, which is otherwise unused for ARM.
+ * We have more than 64-bits worth of state per TB (AArch64 needs
+ * TBFLAG_ANY (15 bits) plus TBFLAG_A64 (51 bits)), so we split the data
+ * between tb->flags and tb->cs_base.
  * We collect these two parts in CPUARMTBFlags where they are named
  * flags and flags2 respectively.
  *
-- 
2.55.0



^ permalink raw reply related	[flat|nested] 102+ messages in thread

* [PATCH 05/24] target/alpha: Use 64-bit TB flags
  2026-11-26 23:35 [PATCH 00/24] accel/tcg: Widen TranslationBlock::flags to 64 bits Philippe Mathieu-Daudé
                   ` (3 preceding siblings ...)
  2026-11-26 23:35 ` [PATCH 04/24] target/arm: Update TB flags split comment for 64-bit tb->flags Philippe Mathieu-Daudé
@ 2026-11-26 23:35 ` Philippe Mathieu-Daudé
  2026-11-27 11:11     ` Anton Johansson via qemu development
  2026-11-26 23:35 ` [PATCH 06/24] target/avr: " Philippe Mathieu-Daudé
                   ` (18 subsequent siblings)
  23 siblings, 1 reply; 102+ messages in thread
From: Philippe Mathieu-Daudé @ 2026-11-26 23:35 UTC (permalink / raw)
  To: qemu-devel
  Cc: Richard Henderson, qemu-riscv, qemu-s390x, qemu-arm, qemu-ppc,
	Anton Johansson, Pierrick Bouvier, Philippe Mathieu-Daudé

TranslationBlock::flags and TCGTBCPUState::flags are now
64-bit, use matching types for the values derived from them.

Signed-off-by: Philippe Mathieu-Daudé <philmd@oss.qualcomm.com>
---
 target/alpha/cpu.c       | 2 +-
 target/alpha/translate.c | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/target/alpha/cpu.c b/target/alpha/cpu.c
index fd099c8e70f9..de452c881172 100644
--- a/target/alpha/cpu.c
+++ b/target/alpha/cpu.c
@@ -44,7 +44,7 @@ static vaddr alpha_cpu_get_pc(CPUState *cs)
 static TCGTBCPUState alpha_get_tb_cpu_state(CPUState *cs)
 {
     CPUAlphaState *env = cpu_env(cs);
-    uint32_t flags = env->flags & ENV_FLAG_TB_MASK;
+    uint64_t flags = env->flags & ENV_FLAG_TB_MASK;
 
 #ifdef CONFIG_USER_ONLY
     flags |= TB_FLAG_UNALIGN * !cs->prctl_unalign_sigbus;
diff --git a/target/alpha/translate.c b/target/alpha/translate.c
index 6f18b8d1af62..2063abf3ce5a 100644
--- a/target/alpha/translate.c
+++ b/target/alpha/translate.c
@@ -48,7 +48,7 @@ struct DisasContext {
 #ifdef CONFIG_USER_ONLY
     MemOp unalign;
 #endif
-    uint32_t tbflags;
+    uint64_t tbflags;
     int mem_idx;
 
     /* True if generating pc-relative code.  */
-- 
2.55.0



^ permalink raw reply related	[flat|nested] 102+ messages in thread

* [PATCH 06/24] target/avr: Use 64-bit TB flags
  2026-11-26 23:35 [PATCH 00/24] accel/tcg: Widen TranslationBlock::flags to 64 bits Philippe Mathieu-Daudé
                   ` (4 preceding siblings ...)
  2026-11-26 23:35 ` [PATCH 05/24] target/alpha: Use 64-bit TB flags Philippe Mathieu-Daudé
@ 2026-11-26 23:35 ` Philippe Mathieu-Daudé
  2026-11-27 11:12     ` Anton Johansson via
  2026-11-26 23:35 ` [PATCH 07/24] target/hexagon: " Philippe Mathieu-Daudé
                   ` (17 subsequent siblings)
  23 siblings, 1 reply; 102+ messages in thread
From: Philippe Mathieu-Daudé @ 2026-11-26 23:35 UTC (permalink / raw)
  To: qemu-devel
  Cc: Richard Henderson, qemu-riscv, qemu-s390x, qemu-arm, qemu-ppc,
	Anton Johansson, Pierrick Bouvier, Philippe Mathieu-Daudé,
	Michael Rolnik

TranslationBlock::flags and TCGTBCPUState::flags are now
64-bit, use matching types for the values derived from them.

Signed-off-by: Philippe Mathieu-Daudé <philmd@oss.qualcomm.com>
---
 target/avr/cpu.c       | 2 +-
 target/avr/translate.c | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/target/avr/cpu.c b/target/avr/cpu.c
index 83710f565182..689d3f6ac5f5 100644
--- a/target/avr/cpu.c
+++ b/target/avr/cpu.c
@@ -58,7 +58,7 @@ static int avr_cpu_mmu_index(CPUState *cs, bool ifetch)
 static TCGTBCPUState avr_get_tb_cpu_state(CPUState *cs)
 {
     CPUAVRState *env = cpu_env(cs);
-    uint32_t flags = 0;
+    uint64_t flags = 0;
 
     if (env->fullacc) {
         flags |= TB_FLAGS_FULL_ACCESS;
diff --git a/target/avr/translate.c b/target/avr/translate.c
index 3c5760609702..6a4e36f326af 100644
--- a/target/avr/translate.c
+++ b/target/avr/translate.c
@@ -2660,7 +2660,7 @@ static bool canonicalize_skip(DisasContext *ctx)
 static void avr_tr_init_disas_context(DisasContextBase *dcbase, CPUState *cs)
 {
     DisasContext *ctx = container_of(dcbase, DisasContext, base);
-    uint32_t tb_flags = ctx->base.tb->flags;
+    uint64_t tb_flags = ctx->base.tb->flags;
 
     ctx->cs = cs;
     ctx->env = cpu_env(cs);
-- 
2.55.0



^ permalink raw reply related	[flat|nested] 102+ messages in thread

* [PATCH 07/24] target/hexagon: Use 64-bit TB flags
  2026-11-26 23:35 [PATCH 00/24] accel/tcg: Widen TranslationBlock::flags to 64 bits Philippe Mathieu-Daudé
                   ` (5 preceding siblings ...)
  2026-11-26 23:35 ` [PATCH 06/24] target/avr: " Philippe Mathieu-Daudé
@ 2026-11-26 23:35 ` Philippe Mathieu-Daudé
  2026-11-27  4:56   ` Brian Cain
  2026-12-01  2:22   ` Brian Cain
  2026-11-26 23:35 ` [PATCH 08/24] target/hppa: " Philippe Mathieu-Daudé
                   ` (16 subsequent siblings)
  23 siblings, 2 replies; 102+ messages in thread
From: Philippe Mathieu-Daudé @ 2026-11-26 23:35 UTC (permalink / raw)
  To: qemu-devel
  Cc: Richard Henderson, qemu-riscv, qemu-s390x, qemu-arm, qemu-ppc,
	Anton Johansson, Pierrick Bouvier, Philippe Mathieu-Daudé,
	Brian Cain

TranslationBlock::flags and TCGTBCPUState::flags are now
64-bit, use matching types for the values derived from them.

Signed-off-by: Philippe Mathieu-Daudé <philmd@oss.qualcomm.com>
---
 target/hexagon/cpu.c       | 16 ++++++++--------
 target/hexagon/translate.c | 14 +++++++-------
 2 files changed, 15 insertions(+), 15 deletions(-)

diff --git a/target/hexagon/cpu.c b/target/hexagon/cpu.c
index 3575b31d1961..3d401cec7929 100644
--- a/target/hexagon/cpu.c
+++ b/target/hexagon/cpu.c
@@ -370,13 +370,13 @@ static TCGTBCPUState hexagon_get_tb_cpu_state(CPUState *cs)
 {
     CPUHexagonState *env = cpu_env(cs);
     vaddr pc = env->gpr[HEX_REG_PC];
-    uint32_t hex_flags = 0;
+    uint64_t hex_flags = 0;
 #ifndef CONFIG_USER_ONLY
     HexagonCPU *cpu;
 #endif
 
     if (pc == env->gpr[HEX_REG_SA0]) {
-        hex_flags = FIELD_DP32(hex_flags, TB_FLAGS, IS_TIGHT_LOOP, 1);
+        hex_flags = FIELD_DP64(hex_flags, TB_FLAGS, IS_TIGHT_LOOP, 1);
     }
     if (pc & PCALIGN_MASK) {
         env->cause_code = HEX_CAUSE_PC_NOT_ALIGNED;
@@ -385,22 +385,22 @@ static TCGTBCPUState hexagon_get_tb_cpu_state(CPUState *cs)
 
 #ifndef CONFIG_USER_ONLY
     cpu = env_archcpu(env);
-    hex_flags = FIELD_DP32(hex_flags, TB_FLAGS, MMU_INDEX,
+    hex_flags = FIELD_DP64(hex_flags, TB_FLAGS, MMU_INDEX,
                            cpu_mmu_index(env_cpu(env), false));
-    hex_flags = FIELD_DP32(hex_flags, TB_FLAGS, HVX_COPROC_ENABLED,
+    hex_flags = FIELD_DP64(hex_flags, TB_FLAGS, HVX_COPROC_ENABLED,
                            cpu->hvx_ctx[0] &&
                            GET_SSR_FIELD(SSR_XE, env->t_sreg[HEX_SREG_SSR]));
-    hex_flags = FIELD_DP32(hex_flags, TB_FLAGS, CPU_MODE,
+    hex_flags = FIELD_DP64(hex_flags, TB_FLAGS, CPU_MODE,
                            get_cpu_mode(env));
     /* Single-step applies only to user and guest mode packets */
-    hex_flags = FIELD_DP32(hex_flags, TB_FLAGS, SS_ACTIVE,
+    hex_flags = FIELD_DP64(hex_flags, TB_FLAGS, SS_ACTIVE,
                            GET_SSR_FIELD(SSR_SS, env->t_sreg[HEX_SREG_SSR]) &&
                            get_cpu_mode(env) != HEX_CPU_MODE_MONITOR);
-    hex_flags = FIELD_DP32(hex_flags, TB_FLAGS, HMX_COPROC_ENABLED,
+    hex_flags = FIELD_DP64(hex_flags, TB_FLAGS, HMX_COPROC_ENABLED,
                            cpu->hmx &&
                            GET_SSR_FIELD(SSR_XE2, env->t_sreg[HEX_SREG_SSR]));
 #else
-    hex_flags = FIELD_DP32(hex_flags, TB_FLAGS, MMU_INDEX, MMU_USER_IDX);
+    hex_flags = FIELD_DP64(hex_flags, TB_FLAGS, MMU_INDEX, MMU_USER_IDX);
 #endif
 
     return (TCGTBCPUState){ .pc = pc, .flags = hex_flags };
diff --git a/target/hexagon/translate.c b/target/hexagon/translate.c
index 11b3917b96c6..f08dc8ef161f 100644
--- a/target/hexagon/translate.c
+++ b/target/hexagon/translate.c
@@ -1570,9 +1570,9 @@ static void hexagon_tr_init_disas_context(DisasContextBase *dcbase,
 {
     DisasContext *ctx = container_of(dcbase, DisasContext, base);
     HexagonCPU *hex_cpu = env_archcpu(cpu_env(cs));
-    uint32_t hex_flags = dcbase->tb->flags;
+    uint64_t hex_flags = dcbase->tb->flags;
 
-    ctx->mem_idx = FIELD_EX32(hex_flags, TB_FLAGS, MMU_INDEX);
+    ctx->mem_idx = FIELD_EX64(hex_flags, TB_FLAGS, MMU_INDEX);
     ctx->num_packets = 0;
     ctx->num_insns = 0;
     ctx->num_hvx_insns = 0;
@@ -1582,23 +1582,23 @@ static void hexagon_tr_init_disas_context(DisasContextBase *dcbase,
     ctx->hlx_check_emitted = false;
 #endif
     ctx->branch_cond = TCG_COND_NEVER;
-    ctx->is_tight_loop = FIELD_EX32(hex_flags, TB_FLAGS, IS_TIGHT_LOOP);
+    ctx->is_tight_loop = FIELD_EX64(hex_flags, TB_FLAGS, IS_TIGHT_LOOP);
     ctx->short_circuit = hex_cpu->cfg.short_circuit;
     ctx->hex_def = HEXAGON_CPU_GET_CLASS(hex_cpu)->hex_def;
     ctx->ieee_fp_extension = hex_cpu->cfg.ieee_fp_extension;
 #ifndef CONFIG_USER_ONLY
     ctx->hvx_coproc_enabled =
-        FIELD_EX32(hex_flags, TB_FLAGS, HVX_COPROC_ENABLED);
+        FIELD_EX64(hex_flags, TB_FLAGS, HVX_COPROC_ENABLED);
     ctx->hvx_check_emitted = false;
-    ctx->cpu_mode = FIELD_EX32(hex_flags, TB_FLAGS, CPU_MODE);
-    ctx->ss_active = FIELD_EX32(hex_flags, TB_FLAGS, SS_ACTIVE);
+    ctx->cpu_mode = FIELD_EX64(hex_flags, TB_FLAGS, CPU_MODE);
+    ctx->ss_active = FIELD_EX64(hex_flags, TB_FLAGS, SS_ACTIVE);
     if (ctx->ss_active) {
         /* Step one packet, and let endloop0 branch within the packet */
         ctx->base.max_insns = 1;
         ctx->is_tight_loop = false;
     }
     ctx->hmx_coproc_enabled =
-        FIELD_EX32(hex_flags, TB_FLAGS, HMX_COPROC_ENABLED);
+        FIELD_EX64(hex_flags, TB_FLAGS, HMX_COPROC_ENABLED);
     ctx->hmx_check_emitted = false;
 #endif
 }
-- 
2.55.0



^ permalink raw reply related	[flat|nested] 102+ messages in thread

* [PATCH 08/24] target/hppa: Use 64-bit TB flags
  2026-11-26 23:35 [PATCH 00/24] accel/tcg: Widen TranslationBlock::flags to 64 bits Philippe Mathieu-Daudé
                   ` (6 preceding siblings ...)
  2026-11-26 23:35 ` [PATCH 07/24] target/hexagon: " Philippe Mathieu-Daudé
@ 2026-11-26 23:35 ` Philippe Mathieu-Daudé
  2026-11-27 11:13     ` Anton Johansson via
  2026-11-26 23:35 ` [PATCH 09/24] target/i386: " Philippe Mathieu-Daudé
                   ` (15 subsequent siblings)
  23 siblings, 1 reply; 102+ messages in thread
From: Philippe Mathieu-Daudé @ 2026-11-26 23:35 UTC (permalink / raw)
  To: qemu-devel
  Cc: Richard Henderson, qemu-riscv, qemu-s390x, qemu-arm, qemu-ppc,
	Anton Johansson, Pierrick Bouvier, Philippe Mathieu-Daudé,
	Helge Deller

TranslationBlock::flags and TCGTBCPUState::flags are now
64-bit, use matching types for the values derived from them.

Signed-off-by: Philippe Mathieu-Daudé <philmd@oss.qualcomm.com>
---
 target/hppa/cpu.c       | 2 +-
 target/hppa/translate.c | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/target/hppa/cpu.c b/target/hppa/cpu.c
index 83104ae0c70f..2e30451f85ad 100644
--- a/target/hppa/cpu.c
+++ b/target/hppa/cpu.c
@@ -56,7 +56,7 @@ static vaddr hppa_cpu_get_pc(CPUState *cs)
 static TCGTBCPUState hppa_get_tb_cpu_state(CPUState *cs)
 {
     CPUHPPAState *env = cpu_env(cs);
-    uint32_t flags = 0;
+    uint64_t flags = 0;
     uint64_t cs_base = 0;
     vaddr pc;
 
diff --git a/target/hppa/translate.c b/target/hppa/translate.c
index ab3505f9c973..16bd0808bb40 100644
--- a/target/hppa/translate.c
+++ b/target/hppa/translate.c
@@ -82,7 +82,7 @@ typedef struct DisasContext {
     TCGv_i64 zero;
 
     uint32_t insn;
-    uint32_t tb_flags;
+    uint64_t tb_flags;
     int mmu_idx;
     int privilege;
     uint32_t psw_xb;
-- 
2.55.0



^ permalink raw reply related	[flat|nested] 102+ messages in thread

* [PATCH 09/24] target/i386: Use 64-bit TB flags
  2026-11-26 23:35 [PATCH 00/24] accel/tcg: Widen TranslationBlock::flags to 64 bits Philippe Mathieu-Daudé
                   ` (7 preceding siblings ...)
  2026-11-26 23:35 ` [PATCH 08/24] target/hppa: " Philippe Mathieu-Daudé
@ 2026-11-26 23:35 ` Philippe Mathieu-Daudé
  2026-11-27 11:14     ` Anton Johansson via
  2026-11-26 23:35 ` [PATCH 10/24] target/loongarch: " Philippe Mathieu-Daudé
                   ` (14 subsequent siblings)
  23 siblings, 1 reply; 102+ messages in thread
From: Philippe Mathieu-Daudé @ 2026-11-26 23:35 UTC (permalink / raw)
  To: qemu-devel
  Cc: Richard Henderson, qemu-riscv, qemu-s390x, qemu-arm, qemu-ppc,
	Anton Johansson, Pierrick Bouvier, Philippe Mathieu-Daudé,
	Paolo Bonzini

TranslationBlock::flags and TCGTBCPUState::flags are now
64-bit, use matching types for the values derived from them.

Signed-off-by: Philippe Mathieu-Daudé <philmd@oss.qualcomm.com>
---
 target/i386/tcg/tcg-cpu.c   | 3 ++-
 target/i386/tcg/translate.c | 4 ++--
 2 files changed, 4 insertions(+), 3 deletions(-)

diff --git a/target/i386/tcg/tcg-cpu.c b/target/i386/tcg/tcg-cpu.c
index 167ff7695ae6..bdfd08107d6a 100644
--- a/target/i386/tcg/tcg-cpu.c
+++ b/target/i386/tcg/tcg-cpu.c
@@ -53,7 +53,8 @@ static void x86_cpu_exec_exit(CPUState *cs)
 static TCGTBCPUState x86_get_tb_cpu_state(CPUState *cs)
 {
     CPUX86State *env = cpu_env(cs);
-    uint32_t flags, cs_base;
+    uint64_t flags;
+    uint32_t cs_base;
     vaddr pc;
 
     flags = env->hflags |
diff --git a/target/i386/tcg/translate.c b/target/i386/tcg/translate.c
index 719771032ff5..af98125cd718 100644
--- a/target/i386/tcg/translate.c
+++ b/target/i386/tcg/translate.c
@@ -122,7 +122,7 @@ typedef struct DisasContext {
 
     CCOp cc_op;  /* current CC operation */
     int mem_index; /* select memory access functions */
-    uint32_t flags; /* all execution flags */
+    uint64_t flags; /* all execution flags */
     int cpuid_features;
     int cpuid_ext_features;
     int cpuid_ext2_features;
@@ -3535,7 +3535,7 @@ static void i386_tr_init_disas_context(DisasContextBase *dcbase, CPUState *cpu)
 {
     DisasContext *dc = container_of(dcbase, DisasContext, base);
     CPUX86State *env = cpu_env(cpu);
-    uint32_t flags = dc->base.tb->flags;
+    uint64_t flags = dc->base.tb->flags;
     uint32_t cflags = tb_cflags(dc->base.tb);
     int cpl = (flags >> HF_CPL_SHIFT) & 3;
     int iopl = (flags >> IOPL_SHIFT) & 3;
-- 
2.55.0



^ permalink raw reply related	[flat|nested] 102+ messages in thread

* [PATCH 10/24] target/loongarch: Use 64-bit TB flags
  2026-11-26 23:35 [PATCH 00/24] accel/tcg: Widen TranslationBlock::flags to 64 bits Philippe Mathieu-Daudé
                   ` (8 preceding siblings ...)
  2026-11-26 23:35 ` [PATCH 09/24] target/i386: " Philippe Mathieu-Daudé
@ 2026-11-26 23:35 ` Philippe Mathieu-Daudé
  2026-11-27 11:16     ` Anton Johansson via
  2026-11-30  1:03   ` Bibo Mao
  2026-11-26 23:35 ` [PATCH 11/24] target/m68k: " Philippe Mathieu-Daudé
                   ` (13 subsequent siblings)
  23 siblings, 2 replies; 102+ messages in thread
From: Philippe Mathieu-Daudé @ 2026-11-26 23:35 UTC (permalink / raw)
  To: qemu-devel
  Cc: Richard Henderson, qemu-riscv, qemu-s390x, qemu-arm, qemu-ppc,
	Anton Johansson, Pierrick Bouvier, Philippe Mathieu-Daudé,
	Song Gao, Bibo Mao, Xianglai Li

TranslationBlock::flags and TCGTBCPUState::flags are now
64-bit, use matching types for the values derived from them.

Signed-off-by: Philippe Mathieu-Daudé <philmd@oss.qualcomm.com>
---
 target/loongarch/tcg/tcg_cpu.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/target/loongarch/tcg/tcg_cpu.c b/target/loongarch/tcg/tcg_cpu.c
index 0549506035f3..743b682f1fb0 100644
--- a/target/loongarch/tcg/tcg_cpu.c
+++ b/target/loongarch/tcg/tcg_cpu.c
@@ -236,7 +236,7 @@ static TCGTBCPUState loongarch_get_tb_cpu_state(CPUState *cs)
 {
     CPULoongArchState *env = cpu_env(cs);
     CPUSysState *sys = env_sys(env);
-    uint32_t flags;
+    uint64_t flags;
 
     flags = sys->CSR_CRMD & (R_CSR_CRMD_PLV_MASK | R_CSR_CRMD_PG_MASK);
     flags |= FIELD_EX64(sys->CSR_EUEN, CSR_EUEN, FPE) * HW_FLAGS_EUEN_FPE;
-- 
2.55.0



^ permalink raw reply related	[flat|nested] 102+ messages in thread

* [PATCH 11/24] target/m68k: Use 64-bit TB flags
  2026-11-26 23:35 [PATCH 00/24] accel/tcg: Widen TranslationBlock::flags to 64 bits Philippe Mathieu-Daudé
                   ` (9 preceding siblings ...)
  2026-11-26 23:35 ` [PATCH 10/24] target/loongarch: " Philippe Mathieu-Daudé
@ 2026-11-26 23:35 ` Philippe Mathieu-Daudé
  2026-11-27 11:16     ` Anton Johansson via
  2026-11-26 23:35 ` [PATCH 12/24] target/microblaze: " Philippe Mathieu-Daudé
                   ` (12 subsequent siblings)
  23 siblings, 1 reply; 102+ messages in thread
From: Philippe Mathieu-Daudé @ 2026-11-26 23:35 UTC (permalink / raw)
  To: qemu-devel
  Cc: Richard Henderson, qemu-riscv, qemu-s390x, qemu-arm, qemu-ppc,
	Anton Johansson, Pierrick Bouvier, Philippe Mathieu-Daudé,
	Laurent Vivier

TranslationBlock::flags and TCGTBCPUState::flags are now
64-bit, use matching types for the values derived from them.

Signed-off-by: Philippe Mathieu-Daudé <philmd@oss.qualcomm.com>
---
 target/m68k/cpu.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/target/m68k/cpu.c b/target/m68k/cpu.c
index f7d289e591a2..74ac2a177cd5 100644
--- a/target/m68k/cpu.c
+++ b/target/m68k/cpu.c
@@ -47,7 +47,7 @@ static vaddr m68k_cpu_get_pc(CPUState *cs)
 static TCGTBCPUState m68k_get_tb_cpu_state(CPUState *cs)
 {
     CPUM68KState *env = cpu_env(cs);
-    uint32_t flags;
+    uint64_t flags;
 
     flags = (env->macsr >> 4) & TB_FLAGS_MACSR;
     if (env->sr & SR_S) {
-- 
2.55.0



^ permalink raw reply related	[flat|nested] 102+ messages in thread

* [PATCH 12/24] target/microblaze: Use 64-bit TB flags
  2026-11-26 23:35 [PATCH 00/24] accel/tcg: Widen TranslationBlock::flags to 64 bits Philippe Mathieu-Daudé
                   ` (10 preceding siblings ...)
  2026-11-26 23:35 ` [PATCH 11/24] target/m68k: " Philippe Mathieu-Daudé
@ 2026-11-26 23:35 ` Philippe Mathieu-Daudé
  2026-11-27 11:17     ` Anton Johansson via qemu development
  2026-11-26 23:35 ` [PATCH 13/24] target/mips: " Philippe Mathieu-Daudé
                   ` (11 subsequent siblings)
  23 siblings, 1 reply; 102+ messages in thread
From: Philippe Mathieu-Daudé @ 2026-11-26 23:35 UTC (permalink / raw)
  To: qemu-devel
  Cc: Richard Henderson, qemu-riscv, qemu-s390x, qemu-arm, qemu-ppc,
	Anton Johansson, Pierrick Bouvier, Philippe Mathieu-Daudé,
	Edgar E. Iglesias

TranslationBlock::flags and TCGTBCPUState::flags are now
64-bit, use matching types for the values derived from them.

Signed-off-by: Philippe Mathieu-Daudé <philmd@oss.qualcomm.com>
---
 target/microblaze/translate.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/target/microblaze/translate.c b/target/microblaze/translate.c
index 8b219afb5dd4..4c869f77f5c0 100644
--- a/target/microblaze/translate.c
+++ b/target/microblaze/translate.c
@@ -68,8 +68,8 @@ typedef struct DisasContext {
 
     /* Decoder.  */
     uint32_t ext_imm;
-    unsigned int tb_flags;
-    unsigned int tb_flags_to_set;
+    uint64_t tb_flags;
+    uint64_t tb_flags_to_set;
     int mem_index;
 
     /* Condition under which to jump, including NEVER and ALWAYS. */
@@ -1668,7 +1668,7 @@ static void mb_tr_translate_insn(DisasContextBase *dcb, CPUState *cs)
         /*
          * Finish any return-from branch.
          */
-        uint32_t rt_ibe = dc->tb_flags & (DRTI_FLAG | DRTB_FLAG | DRTE_FLAG);
+        uint64_t rt_ibe = dc->tb_flags & (DRTI_FLAG | DRTB_FLAG | DRTE_FLAG);
         if (unlikely(rt_ibe != 0)) {
             dc->tb_flags &= ~(DRTI_FLAG | DRTB_FLAG | DRTE_FLAG);
             if (rt_ibe & DRTI_FLAG) {
-- 
2.55.0



^ permalink raw reply related	[flat|nested] 102+ messages in thread

* [PATCH 13/24] target/mips: Use 64-bit TB flags
  2026-11-26 23:35 [PATCH 00/24] accel/tcg: Widen TranslationBlock::flags to 64 bits Philippe Mathieu-Daudé
                   ` (11 preceding siblings ...)
  2026-11-26 23:35 ` [PATCH 12/24] target/microblaze: " Philippe Mathieu-Daudé
@ 2026-11-26 23:35 ` Philippe Mathieu-Daudé
  2026-11-27 11:19     ` Anton Johansson via
  2026-11-26 23:35 ` [PATCH 14/24] target/or1k: " Philippe Mathieu-Daudé
                   ` (10 subsequent siblings)
  23 siblings, 1 reply; 102+ messages in thread
From: Philippe Mathieu-Daudé @ 2026-11-26 23:35 UTC (permalink / raw)
  To: qemu-devel
  Cc: Richard Henderson, qemu-riscv, qemu-s390x, qemu-arm, qemu-ppc,
	Anton Johansson, Pierrick Bouvier, Philippe Mathieu-Daudé,
	Aurelien Jarno, Jiaxun Yang, Aleksandar Rikalo

TranslationBlock::flags and TCGTBCPUState::flags are now
64-bit, use matching types for the values derived from them.

Signed-off-by: Philippe Mathieu-Daudé <philmd@oss.qualcomm.com>
---
 target/mips/cpu.c           | 2 +-
 target/mips/tcg/translate.c | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/target/mips/cpu.c b/target/mips/cpu.c
index 324e5989cca1..fb2ece5c9a46 100644
--- a/target/mips/cpu.c
+++ b/target/mips/cpu.c
@@ -682,7 +682,7 @@ static int mips_cpu_mmu_index(CPUState *cs, bool ifunc)
 static TCGTBCPUState mips_get_tb_cpu_state(CPUState *cs)
 {
     CPUMIPSState *env = cpu_env(cs);
-    uint32_t flags = env->hflags & MIPS_HFLAG_TB_MASK;
+    uint64_t flags = env->hflags & MIPS_HFLAG_TB_MASK;
 
 #ifdef CONFIG_USER_ONLY
     if (!cs->prctl_unalign_sigbus) {
diff --git a/target/mips/tcg/translate.c b/target/mips/tcg/translate.c
index bbcccbbb467f..9c76f1bc00ec 100644
--- a/target/mips/tcg/translate.c
+++ b/target/mips/tcg/translate.c
@@ -15127,7 +15127,7 @@ static void mips_tr_init_disas_context(DisasContextBase *dcbase, CPUState *cs)
 {
     DisasContext *ctx = container_of(dcbase, DisasContext, base);
     CPUMIPSState *env = cpu_env(cs);
-    uint32_t tb_flags = ctx->base.tb->flags;
+    uint64_t tb_flags = ctx->base.tb->flags;
 
     ctx->page_start = ctx->base.pc_first & TARGET_PAGE_MASK;
     ctx->saved_pc = -1;
-- 
2.55.0



^ permalink raw reply related	[flat|nested] 102+ messages in thread

* [PATCH 14/24] target/or1k: Use 64-bit TB flags
  2026-11-26 23:35 [PATCH 00/24] accel/tcg: Widen TranslationBlock::flags to 64 bits Philippe Mathieu-Daudé
                   ` (12 preceding siblings ...)
  2026-11-26 23:35 ` [PATCH 13/24] target/mips: " Philippe Mathieu-Daudé
@ 2026-11-26 23:35 ` Philippe Mathieu-Daudé
  2026-11-27 11:20     ` Anton Johansson via
  2026-11-26 23:35 ` [PATCH 15/24] target/ppc: " Philippe Mathieu-Daudé
                   ` (9 subsequent siblings)
  23 siblings, 1 reply; 102+ messages in thread
From: Philippe Mathieu-Daudé @ 2026-11-26 23:35 UTC (permalink / raw)
  To: qemu-devel
  Cc: Richard Henderson, qemu-riscv, qemu-s390x, qemu-arm, qemu-ppc,
	Anton Johansson, Pierrick Bouvier, Philippe Mathieu-Daudé,
	Stafford Horne

TranslationBlock::flags and TCGTBCPUState::flags are now
64-bit, use matching types for the values derived from them.

Signed-off-by: Philippe Mathieu-Daudé <philmd@oss.qualcomm.com>
---
 target/or1k/translate.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/target/or1k/translate.c b/target/or1k/translate.c
index e00ef45b9b76..e656301642d8 100644
--- a/target/or1k/translate.c
+++ b/target/or1k/translate.c
@@ -45,7 +45,7 @@
 typedef struct DisasContext {
     DisasContextBase base;
     uint32_t mem_idx;
-    uint32_t tb_flags;
+    uint64_t tb_flags;
     uint32_t delayed_branch;
     uint32_t cpucfgr;
     uint32_t avr;
-- 
2.55.0



^ permalink raw reply related	[flat|nested] 102+ messages in thread

* [PATCH 15/24] target/ppc: Use 64-bit TB flags
  2026-11-26 23:35 [PATCH 00/24] accel/tcg: Widen TranslationBlock::flags to 64 bits Philippe Mathieu-Daudé
                   ` (13 preceding siblings ...)
  2026-11-26 23:35 ` [PATCH 14/24] target/or1k: " Philippe Mathieu-Daudé
@ 2026-11-26 23:35 ` Philippe Mathieu-Daudé
  2026-11-27  7:57   ` Chinmay Rath
  2026-11-26 23:35 ` [PATCH 16/24] target/riscv: " Philippe Mathieu-Daudé
                   ` (8 subsequent siblings)
  23 siblings, 1 reply; 102+ messages in thread
From: Philippe Mathieu-Daudé @ 2026-11-26 23:35 UTC (permalink / raw)
  To: qemu-devel
  Cc: Richard Henderson, qemu-riscv, qemu-s390x, qemu-arm, qemu-ppc,
	Anton Johansson, Pierrick Bouvier, Philippe Mathieu-Daudé,
	Chinmay Rath, Nicholas Piggin, Glenn Miles, Harsh Prateek Bora

TranslationBlock::flags and TCGTBCPUState::flags are now
64-bit, use matching types for the values derived from them.

Signed-off-by: Philippe Mathieu-Daudé <philmd@oss.qualcomm.com>
---
 target/ppc/translate.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/target/ppc/translate.c b/target/ppc/translate.c
index dccae25bb4ec..e7bb0e4d4667 100644
--- a/target/ppc/translate.c
+++ b/target/ppc/translate.c
@@ -4996,7 +4996,7 @@ static void ppc_tr_init_disas_context(DisasContextBase *dcbase, CPUState *cs)
 {
     DisasContext *ctx = container_of(dcbase, DisasContext, base);
     CPUPPCState *env = cpu_env(cs);
-    uint32_t hflags = ctx->base.tb->flags;
+    uint64_t hflags = ctx->base.tb->flags;
 
     ctx->spr_cb = env->spr_cb;
     ctx->pr = (hflags >> HFLAGS_PR) & 1;
-- 
2.55.0



^ permalink raw reply related	[flat|nested] 102+ messages in thread

* [PATCH 16/24] target/riscv: Use 64-bit TB flags
  2026-11-26 23:35 [PATCH 00/24] accel/tcg: Widen TranslationBlock::flags to 64 bits Philippe Mathieu-Daudé
                   ` (14 preceding siblings ...)
  2026-11-26 23:35 ` [PATCH 15/24] target/ppc: " Philippe Mathieu-Daudé
@ 2026-11-26 23:35 ` Philippe Mathieu-Daudé
  2026-11-27 11:23     ` Anton Johansson via qemu development
                     ` (2 more replies)
  2026-11-26 23:35 ` [PATCH 17/24] target/riscv: Partially revert use of tb->cs_base Philippe Mathieu-Daudé
                   ` (7 subsequent siblings)
  23 siblings, 3 replies; 102+ messages in thread
From: Philippe Mathieu-Daudé @ 2026-11-26 23:35 UTC (permalink / raw)
  To: qemu-devel
  Cc: Richard Henderson, qemu-riscv, qemu-s390x, qemu-arm, qemu-ppc,
	Anton Johansson, Pierrick Bouvier, Philippe Mathieu-Daudé,
	Palmer Dabbelt, Alistair Francis, Weiwei Li,
	Daniel Henrique Barboza, Liu Zhiwei, Chao Liu

TranslationBlock::flags and TCGTBCPUState::flags are now
64-bit, use matching types for the values derived from them.

Signed-off-by: Philippe Mathieu-Daudé <philmd@oss.qualcomm.com>
---
 target/riscv/tcg/tcg-cpu.c   | 46 ++++++++++++++++++------------------
 target/riscv/tcg/translate.c | 42 ++++++++++++++++----------------
 2 files changed, 44 insertions(+), 44 deletions(-)

diff --git a/target/riscv/tcg/tcg-cpu.c b/target/riscv/tcg/tcg-cpu.c
index 5834ec1524f1..362471d7c8e4 100644
--- a/target/riscv/tcg/tcg-cpu.c
+++ b/target/riscv/tcg/tcg-cpu.c
@@ -104,7 +104,7 @@ static TCGTBCPUState riscv_get_tb_cpu_state(CPUState *cs)
     CPURISCVState *env = cpu_env(cs);
     RISCVCPU *cpu = env_archcpu(env);
     RISCVExtStatus fs, vs;
-    uint32_t flags = 0;
+    uint64_t flags = 0;
     uint64_t ext_flags = 0;
     bool pm_signext = riscv_cpu_virt_mem_enabled(env, false);
 
@@ -126,19 +126,19 @@ static TCGTBCPUState riscv_get_tb_cpu_state(CPUState *cs)
         uint32_t maxsz = vlmax << vsew;
         bool vl_eq_vlmax = (env->vstart == 0) && (vlmax == env->vl) &&
                            (maxsz >= 8);
-        flags = FIELD_DP32(flags, TB_FLAGS, VILL, env->vill);
-        flags = FIELD_DP32(flags, TB_FLAGS, SEW, vsew);
-        flags = FIELD_DP32(flags, TB_FLAGS, LMUL,
+        flags = FIELD_DP64(flags, TB_FLAGS, VILL, env->vill);
+        flags = FIELD_DP64(flags, TB_FLAGS, SEW, vsew);
+        flags = FIELD_DP64(flags, TB_FLAGS, LMUL,
                            FIELD_EX64(env->vtype, VTYPE, VLMUL));
-        flags = FIELD_DP32(flags, TB_FLAGS, VL_EQ_VLMAX, vl_eq_vlmax);
-        flags = FIELD_DP32(flags, TB_FLAGS, VTA,
+        flags = FIELD_DP64(flags, TB_FLAGS, VL_EQ_VLMAX, vl_eq_vlmax);
+        flags = FIELD_DP64(flags, TB_FLAGS, VTA,
                            FIELD_EX64(env->vtype, VTYPE, VTA));
-        flags = FIELD_DP32(flags, TB_FLAGS, VMA,
+        flags = FIELD_DP64(flags, TB_FLAGS, VMA,
                            FIELD_EX64(env->vtype, VTYPE, VMA));
-        flags = FIELD_DP32(flags, TB_FLAGS, VSTART_EQ_ZERO, env->vstart == 0);
+        flags = FIELD_DP64(flags, TB_FLAGS, VSTART_EQ_ZERO, env->vstart == 0);
         ext_flags = FIELD_DP64(ext_flags, EXT_TB_FLAGS, ALTFMT, altfmt);
     } else {
-        flags = FIELD_DP32(flags, TB_FLAGS, VILL, 1);
+        flags = FIELD_DP64(flags, TB_FLAGS, VILL, 1);
     }
 
     if (cpu_get_fcfien(env)) {
@@ -147,26 +147,26 @@ static TCGTBCPUState riscv_get_tb_cpu_state(CPUState *cs)
          * the start of the block is tracked via env->elp. env->elp
          * is turned on during jalr translation.
          */
-        flags = FIELD_DP32(flags, TB_FLAGS, FCFI_LP_EXPECTED, env->elp);
-        flags = FIELD_DP32(flags, TB_FLAGS, FCFI_ENABLED, 1);
+        flags = FIELD_DP64(flags, TB_FLAGS, FCFI_LP_EXPECTED, env->elp);
+        flags = FIELD_DP64(flags, TB_FLAGS, FCFI_ENABLED, 1);
     }
 
     if (cpu_get_bcfien(env)) {
-        flags = FIELD_DP32(flags, TB_FLAGS, BCFI_ENABLED, 1);
+        flags = FIELD_DP64(flags, TB_FLAGS, BCFI_ENABLED, 1);
     }
 
 #ifdef CONFIG_USER_ONLY
     fs = EXT_STATUS_DIRTY;
     vs = EXT_STATUS_DIRTY;
 #else
-    flags = FIELD_DP32(flags, TB_FLAGS, PRIV, env->priv);
+    flags = FIELD_DP64(flags, TB_FLAGS, PRIV, env->priv);
 
     flags |= riscv_env_mmu_index(env, 0);
     fs = get_field(env->mstatus, MSTATUS_FS);
     vs = get_field(env->mstatus, MSTATUS_VS);
 
     if (env->virt_enabled) {
-        flags = FIELD_DP32(flags, TB_FLAGS, VIRT_ENABLED, 1);
+        flags = FIELD_DP64(flags, TB_FLAGS, VIRT_ENABLED, 1);
         /*
          * Merge DISABLED and !DIRTY states using MIN.
          * We will set both fields when dirtying.
@@ -183,16 +183,16 @@ static TCGTBCPUState riscv_get_tb_cpu_state(CPUState *cs)
 
     if ((cpu->cfg.debug || cpu->cfg.ext_sdtrig)
         && !icount_enabled()) {
-        flags = FIELD_DP32(flags, TB_FLAGS, ITRIGGER, env->itrigger_enabled);
+        flags = FIELD_DP64(flags, TB_FLAGS, ITRIGGER, env->itrigger_enabled);
     }
 #endif
 
-    flags = FIELD_DP32(flags, TB_FLAGS, FS, fs);
-    flags = FIELD_DP32(flags, TB_FLAGS, VS, vs);
-    flags = FIELD_DP32(flags, TB_FLAGS, XL, env->xl);
-    flags = FIELD_DP32(flags, TB_FLAGS, AXL, cpu_address_xl(env));
-    flags = FIELD_DP32(flags, TB_FLAGS, PM_PMM, riscv_pm_get_pmm(env));
-    flags = FIELD_DP32(flags, TB_FLAGS, PM_SIGNEXTEND, pm_signext);
+    flags = FIELD_DP64(flags, TB_FLAGS, FS, fs);
+    flags = FIELD_DP64(flags, TB_FLAGS, VS, vs);
+    flags = FIELD_DP64(flags, TB_FLAGS, XL, env->xl);
+    flags = FIELD_DP64(flags, TB_FLAGS, AXL, cpu_address_xl(env));
+    flags = FIELD_DP64(flags, TB_FLAGS, PM_PMM, riscv_pm_get_pmm(env));
+    flags = FIELD_DP64(flags, TB_FLAGS, PM_SIGNEXTEND, pm_signext);
 
     ext_flags = FIELD_DP64(ext_flags, EXT_TB_FLAGS, MISA_EXT, env->misa_ext);
     ext_flags = FIELD_DP64(ext_flags, EXT_TB_FLAGS, BIG_ENDIAN,
@@ -216,7 +216,7 @@ static void riscv_cpu_synchronize_from_tb(CPUState *cs,
     if (!(tb_cflags(tb) & CF_PCREL)) {
         RISCVCPU *cpu = RISCV_CPU(cs);
         CPURISCVState *env = &cpu->env;
-        RISCVMXL xl = FIELD_EX32(tb->flags, TB_FLAGS, XL);
+        RISCVMXL xl = FIELD_EX64(tb->flags, TB_FLAGS, XL);
 
         tcg_debug_assert(!tcg_cflags_has(cs, CF_PCREL));
 
@@ -234,7 +234,7 @@ static void riscv_restore_state_to_opc(CPUState *cs,
 {
     RISCVCPU *cpu = RISCV_CPU(cs);
     CPURISCVState *env = &cpu->env;
-    RISCVMXL xl = FIELD_EX32(tb->flags, TB_FLAGS, XL);
+    RISCVMXL xl = FIELD_EX64(tb->flags, TB_FLAGS, XL);
     target_ulong pc;
 
     if (tb_cflags(tb) & CF_PCREL) {
diff --git a/target/riscv/tcg/translate.c b/target/riscv/tcg/translate.c
index 79b0f444efbd..255433593dd9 100644
--- a/target/riscv/tcg/translate.c
+++ b/target/riscv/tcg/translate.c
@@ -1323,45 +1323,45 @@ static void riscv_tr_init_disas_context(DisasContextBase *dcbase, CPUState *cs)
     CPURISCVState *env = cpu_env(cs);
     RISCVCPUClass *mcc = RISCV_CPU_GET_CLASS(cs);
     RISCVCPU *cpu = RISCV_CPU(cs);
-    uint32_t tb_flags = ctx->base.tb->flags;
+    uint64_t tb_flags = ctx->base.tb->flags;
     uint64_t ext_tb_flags = ctx->base.tb->cs_base;
 
     ctx->pc_save = ctx->base.pc_first;
-    ctx->priv = FIELD_EX32(tb_flags, TB_FLAGS, PRIV);
-    ctx->mem_idx = FIELD_EX32(tb_flags, TB_FLAGS, MEM_IDX);
-    ctx->mstatus_fs = FIELD_EX32(tb_flags, TB_FLAGS, FS);
-    ctx->mstatus_vs = FIELD_EX32(tb_flags, TB_FLAGS, VS);
+    ctx->priv = FIELD_EX64(tb_flags, TB_FLAGS, PRIV);
+    ctx->mem_idx = FIELD_EX64(tb_flags, TB_FLAGS, MEM_IDX);
+    ctx->mstatus_fs = FIELD_EX64(tb_flags, TB_FLAGS, FS);
+    ctx->mstatus_vs = FIELD_EX64(tb_flags, TB_FLAGS, VS);
     ctx->priv_ver = env->priv_ver;
-    ctx->virt_enabled = FIELD_EX32(tb_flags, TB_FLAGS, VIRT_ENABLED);
+    ctx->virt_enabled = FIELD_EX64(tb_flags, TB_FLAGS, VIRT_ENABLED);
     ctx->misa_ext = env->misa_ext;
     ctx->frm = -1;  /* unknown rounding mode */
     ctx->cfg_ptr = &(cpu->cfg);
-    ctx->vill = FIELD_EX32(tb_flags, TB_FLAGS, VILL);
-    ctx->sew = FIELD_EX32(tb_flags, TB_FLAGS, SEW);
-    ctx->lmul = sextract32(FIELD_EX32(tb_flags, TB_FLAGS, LMUL), 0, 3);
-    ctx->vta = FIELD_EX32(tb_flags, TB_FLAGS, VTA) && cpu->cfg.rvv_ta_all_1s;
-    ctx->vma = FIELD_EX32(tb_flags, TB_FLAGS, VMA) && cpu->cfg.rvv_ma_all_1s;
+    ctx->vill = FIELD_EX64(tb_flags, TB_FLAGS, VILL);
+    ctx->sew = FIELD_EX64(tb_flags, TB_FLAGS, SEW);
+    ctx->lmul = sextract32(FIELD_EX64(tb_flags, TB_FLAGS, LMUL), 0, 3);
+    ctx->vta = FIELD_EX64(tb_flags, TB_FLAGS, VTA) && cpu->cfg.rvv_ta_all_1s;
+    ctx->vma = FIELD_EX64(tb_flags, TB_FLAGS, VMA) && cpu->cfg.rvv_ma_all_1s;
     ctx->cfg_vta_all_1s = cpu->cfg.rvv_ta_all_1s;
-    ctx->vstart_eq_zero = FIELD_EX32(tb_flags, TB_FLAGS, VSTART_EQ_ZERO);
-    ctx->vl_eq_vlmax = FIELD_EX32(tb_flags, TB_FLAGS, VL_EQ_VLMAX);
+    ctx->vstart_eq_zero = FIELD_EX64(tb_flags, TB_FLAGS, VSTART_EQ_ZERO);
+    ctx->vl_eq_vlmax = FIELD_EX64(tb_flags, TB_FLAGS, VL_EQ_VLMAX);
     ctx->altfmt = FIELD_EX64(ext_tb_flags, EXT_TB_FLAGS, ALTFMT);
     ctx->misa_mxl_max = mcc->def->misa_mxl_max;
-    ctx->xl = FIELD_EX32(tb_flags, TB_FLAGS, XL);
-    ctx->address_xl = FIELD_EX32(tb_flags, TB_FLAGS, AXL);
+    ctx->xl = FIELD_EX64(tb_flags, TB_FLAGS, XL);
+    ctx->address_xl = FIELD_EX64(tb_flags, TB_FLAGS, AXL);
     ctx->cs = cs;
     if (get_xl(ctx) == MXL_RV32) {
         ctx->addr_xl = 32;
         ctx->addr_signed = false;
     } else {
-        int pm_pmm = FIELD_EX32(tb_flags, TB_FLAGS, PM_PMM);
+        int pm_pmm = FIELD_EX64(tb_flags, TB_FLAGS, PM_PMM);
         ctx->addr_xl = 64 - riscv_pm_get_pmlen(pm_pmm);
-        ctx->addr_signed = FIELD_EX32(tb_flags, TB_FLAGS, PM_SIGNEXTEND);
+        ctx->addr_signed = FIELD_EX64(tb_flags, TB_FLAGS, PM_SIGNEXTEND);
     }
     ctx->ztso = cpu->cfg.ext_ztso;
-    ctx->itrigger = FIELD_EX32(tb_flags, TB_FLAGS, ITRIGGER);
-    ctx->bcfi_enabled = FIELD_EX32(tb_flags, TB_FLAGS, BCFI_ENABLED);
-    ctx->fcfi_lp_expected = FIELD_EX32(tb_flags, TB_FLAGS, FCFI_LP_EXPECTED);
-    ctx->fcfi_enabled = FIELD_EX32(tb_flags, TB_FLAGS, FCFI_ENABLED);
+    ctx->itrigger = FIELD_EX64(tb_flags, TB_FLAGS, ITRIGGER);
+    ctx->bcfi_enabled = FIELD_EX64(tb_flags, TB_FLAGS, BCFI_ENABLED);
+    ctx->fcfi_lp_expected = FIELD_EX64(tb_flags, TB_FLAGS, FCFI_LP_EXPECTED);
+    ctx->fcfi_enabled = FIELD_EX64(tb_flags, TB_FLAGS, FCFI_ENABLED);
     ctx->sdext_step = FIELD_EX64(ext_tb_flags, EXT_TB_FLAGS, SDEXT_STEP);
     ctx->zero = tcg_constant_tl(0);
     ctx->virt_inst_excp = false;
-- 
2.55.0



^ permalink raw reply related	[flat|nested] 102+ messages in thread

* [PATCH 17/24] target/riscv: Partially revert use of tb->cs_base
  2026-11-26 23:35 [PATCH 00/24] accel/tcg: Widen TranslationBlock::flags to 64 bits Philippe Mathieu-Daudé
                   ` (15 preceding siblings ...)
  2026-11-26 23:35 ` [PATCH 16/24] target/riscv: " Philippe Mathieu-Daudé
@ 2026-11-26 23:35 ` Philippe Mathieu-Daudé
  2026-11-27 11:26     ` Anton Johansson via
  2026-12-01  1:18   ` Alistair Francis
  2026-11-26 23:35 ` [PATCH 18/24] target/rx: Use 64-bit TB flags Philippe Mathieu-Daudé
                   ` (6 subsequent siblings)
  23 siblings, 2 replies; 102+ messages in thread
From: Philippe Mathieu-Daudé @ 2026-11-26 23:35 UTC (permalink / raw)
  To: qemu-devel
  Cc: Richard Henderson, qemu-riscv, qemu-s390x, qemu-arm, qemu-ppc,
	Anton Johansson, Pierrick Bouvier, Philippe Mathieu-Daudé,
	Palmer Dabbelt, Alistair Francis, Weiwei Li,
	Daniel Henrique Barboza, Liu Zhiwei, Chao Liu

Partially revert commit 1c88ab9e77bd ("target/riscv: Use the
tb->cs_base as the extend tb flags"): now that TranslationBlock::flags
is 64-bit, keep only misa_ext in tb->cs_base (as in 55b490b58fbf) and
move the other extended flags (ALTFMT, BIG_ENDIAN, SDEXT_STEP) into
TB_FLAGS at bits 32+.

Signed-off-by: Philippe Mathieu-Daudé <philmd@oss.qualcomm.com>
---
 include/exec/translation-block.h |  2 +-
 target/riscv/cpu.h               |  8 +++-----
 target/riscv/tcg/tcg-cpu.c       | 12 +++++-------
 target/riscv/tcg/translate.c     |  7 +++----
 4 files changed, 12 insertions(+), 17 deletions(-)

diff --git a/include/exec/translation-block.h b/include/exec/translation-block.h
index f9f4876e6dd3..491de24d71b9 100644
--- a/include/exec/translation-block.h
+++ b/include/exec/translation-block.h
@@ -65,7 +65,7 @@ struct TranslationBlock {
      * arm: an extension of tb->flags,
      * s390x: instruction data for EXECUTE,
      * sparc: the next pc of the instruction queue (for delay slots),
-     * riscv: an extension of tb->flags.
+     * riscv: misa_ext.
      */
     uint64_t cs_base;
 
diff --git a/target/riscv/cpu.h b/target/riscv/cpu.h
index 49a1186bdbb2..be5d520e200b 100644
--- a/target/riscv/cpu.h
+++ b/target/riscv/cpu.h
@@ -777,12 +777,10 @@ FIELD(TB_FLAGS, BCFI_ENABLED, 28, 1)
 /* If pointer masking should be applied and address sign extended */
 FIELD(TB_FLAGS, PM_PMM, 29, 2)
 FIELD(TB_FLAGS, PM_SIGNEXTEND, 31, 1)
-
-FIELD(EXT_TB_FLAGS, MISA_EXT, 0, 32)
-FIELD(EXT_TB_FLAGS, ALTFMT, 32, 1)
-FIELD(EXT_TB_FLAGS, BIG_ENDIAN, 33, 1)
+FIELD(TB_FLAGS, ALTFMT, 32, 1)
+FIELD(TB_FLAGS, BIG_ENDIAN, 33, 1)
 /* sdext single-step needs a TB flag to build 1-insn TBs */
-FIELD(EXT_TB_FLAGS, SDEXT_STEP, 34, 1)
+FIELD(TB_FLAGS, SDEXT_STEP, 34, 1)
 
 #ifdef TARGET_RISCV32
 #define riscv_cpu_mxl(env)  ((void)(env), MXL_RV32)
diff --git a/target/riscv/tcg/tcg-cpu.c b/target/riscv/tcg/tcg-cpu.c
index 362471d7c8e4..7a06979f9bee 100644
--- a/target/riscv/tcg/tcg-cpu.c
+++ b/target/riscv/tcg/tcg-cpu.c
@@ -105,7 +105,6 @@ static TCGTBCPUState riscv_get_tb_cpu_state(CPUState *cs)
     RISCVCPU *cpu = env_archcpu(env);
     RISCVExtStatus fs, vs;
     uint64_t flags = 0;
-    uint64_t ext_flags = 0;
     bool pm_signext = riscv_cpu_virt_mem_enabled(env, false);
 
     if (cpu->cfg.ext_zve32x) {
@@ -136,7 +135,7 @@ static TCGTBCPUState riscv_get_tb_cpu_state(CPUState *cs)
         flags = FIELD_DP64(flags, TB_FLAGS, VMA,
                            FIELD_EX64(env->vtype, VTYPE, VMA));
         flags = FIELD_DP64(flags, TB_FLAGS, VSTART_EQ_ZERO, env->vstart == 0);
-        ext_flags = FIELD_DP64(ext_flags, EXT_TB_FLAGS, ALTFMT, altfmt);
+        flags = FIELD_DP64(flags, TB_FLAGS, ALTFMT, altfmt);
     } else {
         flags = FIELD_DP64(flags, TB_FLAGS, VILL, 1);
     }
@@ -194,19 +193,18 @@ static TCGTBCPUState riscv_get_tb_cpu_state(CPUState *cs)
     flags = FIELD_DP64(flags, TB_FLAGS, PM_PMM, riscv_pm_get_pmm(env));
     flags = FIELD_DP64(flags, TB_FLAGS, PM_SIGNEXTEND, pm_signext);
 
-    ext_flags = FIELD_DP64(ext_flags, EXT_TB_FLAGS, MISA_EXT, env->misa_ext);
-    ext_flags = FIELD_DP64(ext_flags, EXT_TB_FLAGS, BIG_ENDIAN,
-                           mo_endian_env(env) == MO_BE);
+    flags = FIELD_DP64(flags, TB_FLAGS, BIG_ENDIAN,
+                       mo_endian_env(env) == MO_BE);
 #ifndef CONFIG_USER_ONLY
     if (cpu->cfg.ext_sdext && !env->debug_mode && (env->dcsr & DCSR_STEP)) {
-        ext_flags = FIELD_DP64(ext_flags, EXT_TB_FLAGS, SDEXT_STEP, 1);
+        flags = FIELD_DP64(flags, TB_FLAGS, SDEXT_STEP, 1);
     }
 #endif
 
     return (TCGTBCPUState){
         .pc = env->xl == MXL_RV32 ? env->pc & UINT32_MAX : env->pc,
         .flags = flags,
-        .cs_base = ext_flags,
+        .cs_base = env->misa_ext,
     };
 }
 
diff --git a/target/riscv/tcg/translate.c b/target/riscv/tcg/translate.c
index 255433593dd9..b810b91dc26a 100644
--- a/target/riscv/tcg/translate.c
+++ b/target/riscv/tcg/translate.c
@@ -1324,7 +1324,6 @@ static void riscv_tr_init_disas_context(DisasContextBase *dcbase, CPUState *cs)
     RISCVCPUClass *mcc = RISCV_CPU_GET_CLASS(cs);
     RISCVCPU *cpu = RISCV_CPU(cs);
     uint64_t tb_flags = ctx->base.tb->flags;
-    uint64_t ext_tb_flags = ctx->base.tb->cs_base;
 
     ctx->pc_save = ctx->base.pc_first;
     ctx->priv = FIELD_EX64(tb_flags, TB_FLAGS, PRIV);
@@ -1344,7 +1343,7 @@ static void riscv_tr_init_disas_context(DisasContextBase *dcbase, CPUState *cs)
     ctx->cfg_vta_all_1s = cpu->cfg.rvv_ta_all_1s;
     ctx->vstart_eq_zero = FIELD_EX64(tb_flags, TB_FLAGS, VSTART_EQ_ZERO);
     ctx->vl_eq_vlmax = FIELD_EX64(tb_flags, TB_FLAGS, VL_EQ_VLMAX);
-    ctx->altfmt = FIELD_EX64(ext_tb_flags, EXT_TB_FLAGS, ALTFMT);
+    ctx->altfmt = FIELD_EX64(tb_flags, TB_FLAGS, ALTFMT);
     ctx->misa_mxl_max = mcc->def->misa_mxl_max;
     ctx->xl = FIELD_EX64(tb_flags, TB_FLAGS, XL);
     ctx->address_xl = FIELD_EX64(tb_flags, TB_FLAGS, AXL);
@@ -1362,11 +1361,11 @@ static void riscv_tr_init_disas_context(DisasContextBase *dcbase, CPUState *cs)
     ctx->bcfi_enabled = FIELD_EX64(tb_flags, TB_FLAGS, BCFI_ENABLED);
     ctx->fcfi_lp_expected = FIELD_EX64(tb_flags, TB_FLAGS, FCFI_LP_EXPECTED);
     ctx->fcfi_enabled = FIELD_EX64(tb_flags, TB_FLAGS, FCFI_ENABLED);
-    ctx->sdext_step = FIELD_EX64(ext_tb_flags, EXT_TB_FLAGS, SDEXT_STEP);
+    ctx->sdext_step = FIELD_EX64(tb_flags, TB_FLAGS, SDEXT_STEP);
     ctx->zero = tcg_constant_tl(0);
     ctx->virt_inst_excp = false;
     ctx->decoders = cpu->decoders;
-    ctx->mo_endianness = FIELD_EX64(ext_tb_flags, EXT_TB_FLAGS, BIG_ENDIAN)
+    ctx->mo_endianness = FIELD_EX64(tb_flags, TB_FLAGS, BIG_ENDIAN)
                          ? MO_BE : MO_LE;
 }
 
-- 
2.55.0



^ permalink raw reply related	[flat|nested] 102+ messages in thread

* [PATCH 18/24] target/rx: Use 64-bit TB flags
  2026-11-26 23:35 [PATCH 00/24] accel/tcg: Widen TranslationBlock::flags to 64 bits Philippe Mathieu-Daudé
                   ` (16 preceding siblings ...)
  2026-11-26 23:35 ` [PATCH 17/24] target/riscv: Partially revert use of tb->cs_base Philippe Mathieu-Daudé
@ 2026-11-26 23:35 ` Philippe Mathieu-Daudé
  2026-11-27 11:27     ` Anton Johansson via
  2026-11-28 13:42   ` yoshinori.sato
  2026-11-26 23:35 ` [PATCH 19/24] target/s390x: " Philippe Mathieu-Daudé
                   ` (5 subsequent siblings)
  23 siblings, 2 replies; 102+ messages in thread
From: Philippe Mathieu-Daudé @ 2026-11-26 23:35 UTC (permalink / raw)
  To: qemu-devel
  Cc: Richard Henderson, qemu-riscv, qemu-s390x, qemu-arm, qemu-ppc,
	Anton Johansson, Pierrick Bouvier, Philippe Mathieu-Daudé,
	Yoshinori Sato

TranslationBlock::flags and TCGTBCPUState::flags are now
64-bit, use matching types for the values derived from them.

Signed-off-by: Philippe Mathieu-Daudé <philmd@oss.qualcomm.com>
---
 target/rx/cpu.c       |  6 +++---
 target/rx/translate.c | 16 ++++++++--------
 2 files changed, 11 insertions(+), 11 deletions(-)

diff --git a/target/rx/cpu.c b/target/rx/cpu.c
index c35a98f7cefa..dba253bda9b1 100644
--- a/target/rx/cpu.c
+++ b/target/rx/cpu.c
@@ -47,10 +47,10 @@ static vaddr rx_cpu_get_pc(CPUState *cs)
 static TCGTBCPUState rx_get_tb_cpu_state(CPUState *cs)
 {
     CPURXState *env = cpu_env(cs);
-    uint32_t flags = 0;
+    uint64_t flags = 0;
 
-    flags = FIELD_DP32(flags, PSW, PM, env->psw_pm);
-    flags = FIELD_DP32(flags, PSW, U, env->psw_u);
+    flags = FIELD_DP64(flags, PSW, PM, env->psw_pm);
+    flags = FIELD_DP64(flags, PSW, U, env->psw_u);
 
     return (TCGTBCPUState){ .pc = env->pc, .flags = flags };
 }
diff --git a/target/rx/translate.c b/target/rx/translate.c
index 1bacc7adf929..69547c83cc05 100644
--- a/target/rx/translate.c
+++ b/target/rx/translate.c
@@ -36,7 +36,7 @@ typedef struct DisasContext {
     DisasContextBase base;
     CPURXState *env;
     uint32_t pc;
-    uint32_t tb_flags;
+    uint64_t tb_flags;
 } DisasContext;
 
 typedef struct DisasCompare {
@@ -243,7 +243,7 @@ static TCGv_i32 rx_load_source(DisasContext *ctx, TCGv_i32 mem,
 /* Processor mode check */
 static int is_privileged(DisasContext *ctx, int is_exception)
 {
-    if (FIELD_EX32(ctx->tb_flags, PSW, PM)) {
+    if (FIELD_EX64(ctx->tb_flags, PSW, PM)) {
         if (is_exception) {
             gen_helper_raise_privilege_violation(tcg_env);
         }
@@ -332,7 +332,7 @@ static void move_from_cr(DisasContext *ctx, TCGv_i32 ret, int cr, uint32_t pc)
         tcg_gen_movi_i32(ret, pc);
         break;
     case 2:     /* USP */
-        if (FIELD_EX32(ctx->tb_flags, PSW, U)) {
+        if (FIELD_EX64(ctx->tb_flags, PSW, U)) {
             tcg_gen_mov_i32(ret, cpu_sp);
         } else {
             tcg_gen_mov_i32(ret, cpu_usp);
@@ -348,7 +348,7 @@ static void move_from_cr(DisasContext *ctx, TCGv_i32 ret, int cr, uint32_t pc)
         tcg_gen_mov_i32(ret, cpu_bpc);
         break;
     case 10:    /* ISP */
-        if (FIELD_EX32(ctx->tb_flags, PSW, U)) {
+        if (FIELD_EX64(ctx->tb_flags, PSW, U)) {
             tcg_gen_mov_i32(ret, cpu_isp);
         } else {
             tcg_gen_mov_i32(ret, cpu_sp);
@@ -386,7 +386,7 @@ static void move_to_cr(DisasContext *ctx, TCGv_i32 val, int cr)
         break;
     /* case 1: to PC not supported */
     case 2:     /* USP */
-        if (FIELD_EX32(ctx->tb_flags, PSW, U)) {
+        if (FIELD_EX64(ctx->tb_flags, PSW, U)) {
             tcg_gen_mov_i32(cpu_sp, val);
         } else {
             tcg_gen_mov_i32(cpu_usp, val);
@@ -402,7 +402,7 @@ static void move_to_cr(DisasContext *ctx, TCGv_i32 val, int cr)
         tcg_gen_mov_i32(cpu_bpc, val);
         break;
     case 10:    /* ISP */
-        if (FIELD_EX32(ctx->tb_flags, PSW, U)) {
+        if (FIELD_EX64(ctx->tb_flags, PSW, U)) {
             tcg_gen_mov_i32(cpu_isp, val);
         } else {
             tcg_gen_mov_i32(cpu_sp, val);
@@ -2080,8 +2080,8 @@ static void clrsetpsw(DisasContext *ctx, int cb, int val)
             ctx->base.is_jmp = DISAS_UPDATE;
             break;
         case PSW_U:
-            if (FIELD_EX32(ctx->tb_flags, PSW, U) != val) {
-                ctx->tb_flags = FIELD_DP32(ctx->tb_flags, PSW, U, val);
+            if (FIELD_EX64(ctx->tb_flags, PSW, U) != val) {
+                ctx->tb_flags = FIELD_DP64(ctx->tb_flags, PSW, U, val);
                 tcg_gen_movi_i32(cpu_psw_u, val);
                 tcg_gen_mov_i32(val ? cpu_isp : cpu_usp, cpu_sp);
                 tcg_gen_mov_i32(cpu_sp, val ? cpu_usp : cpu_isp);
-- 
2.55.0



^ permalink raw reply related	[flat|nested] 102+ messages in thread

* [PATCH 19/24] target/s390x: Use 64-bit TB flags
  2026-11-26 23:35 [PATCH 00/24] accel/tcg: Widen TranslationBlock::flags to 64 bits Philippe Mathieu-Daudé
                   ` (17 preceding siblings ...)
  2026-11-26 23:35 ` [PATCH 18/24] target/rx: Use 64-bit TB flags Philippe Mathieu-Daudé
@ 2026-11-26 23:35 ` Philippe Mathieu-Daudé
  2026-11-27 11:27     ` Anton Johansson via
  2026-11-26 23:35 ` [PATCH 20/24] target/sh4: " Philippe Mathieu-Daudé
                   ` (4 subsequent siblings)
  23 siblings, 1 reply; 102+ messages in thread
From: Philippe Mathieu-Daudé @ 2026-11-26 23:35 UTC (permalink / raw)
  To: qemu-devel
  Cc: Richard Henderson, qemu-riscv, qemu-s390x, qemu-arm, qemu-ppc,
	Anton Johansson, Pierrick Bouvier, Philippe Mathieu-Daudé,
	Ilya Leoshkevich, David Hildenbrand, Cornelia Huck, Eric Farman,
	Matthew Rosato

TranslationBlock::flags and TCGTBCPUState::flags are now
64-bit, use matching types for the values derived from them.

Signed-off-by: Philippe Mathieu-Daudé <philmd@oss.qualcomm.com>
---
 target/s390x/cpu.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/target/s390x/cpu.c b/target/s390x/cpu.c
index d1250945d489..c6564974c50e 100644
--- a/target/s390x/cpu.c
+++ b/target/s390x/cpu.c
@@ -319,7 +319,7 @@ static int s390x_cpu_mmu_index(CPUState *cs, bool ifetch)
 static TCGTBCPUState s390x_get_tb_cpu_state(CPUState *cs)
 {
     CPUS390XState *env = cpu_env(cs);
-    uint32_t flags;
+    uint64_t flags;
 
     if (env->psw.addr & 1) {
         /*
-- 
2.55.0



^ permalink raw reply related	[flat|nested] 102+ messages in thread

* [PATCH 20/24] target/sh4: Use 64-bit TB flags
  2026-11-26 23:35 [PATCH 00/24] accel/tcg: Widen TranslationBlock::flags to 64 bits Philippe Mathieu-Daudé
                   ` (18 preceding siblings ...)
  2026-11-26 23:35 ` [PATCH 19/24] target/s390x: " Philippe Mathieu-Daudé
@ 2026-11-26 23:35 ` Philippe Mathieu-Daudé
  2026-11-27 11:29     ` Anton Johansson via
  2026-11-28 13:42   ` yoshinori.sato
  2026-11-26 23:35 ` [PATCH 21/24] target/sparc: " Philippe Mathieu-Daudé
                   ` (3 subsequent siblings)
  23 siblings, 2 replies; 102+ messages in thread
From: Philippe Mathieu-Daudé @ 2026-11-26 23:35 UTC (permalink / raw)
  To: qemu-devel
  Cc: Richard Henderson, qemu-riscv, qemu-s390x, qemu-arm, qemu-ppc,
	Anton Johansson, Pierrick Bouvier, Philippe Mathieu-Daudé,
	Yoshinori Sato

TranslationBlock::flags and TCGTBCPUState::flags are now
64-bit, use matching types for the values derived from them.

Signed-off-by: Philippe Mathieu-Daudé <philmd@oss.qualcomm.com>
---
 target/sh4/cpu.c       | 2 +-
 target/sh4/translate.c | 4 ++--
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/target/sh4/cpu.c b/target/sh4/cpu.c
index 17731935779e..90e3e4d52b82 100644
--- a/target/sh4/cpu.c
+++ b/target/sh4/cpu.c
@@ -47,7 +47,7 @@ static vaddr superh_cpu_get_pc(CPUState *cs)
 static TCGTBCPUState superh_get_tb_cpu_state(CPUState *cs)
 {
     CPUSH4State *env = cpu_env(cs);
-    uint32_t flags;
+    uint64_t flags;
 
     flags = env->flags
             | (env->fpscr & TB_FLAG_FPSCR_MASK)
diff --git a/target/sh4/translate.c b/target/sh4/translate.c
index 5729a757f191..0f43a5dced14 100644
--- a/target/sh4/translate.c
+++ b/target/sh4/translate.c
@@ -36,7 +36,7 @@
 typedef struct DisasContext {
     DisasContextBase base;
 
-    uint32_t tbflags;  /* should stay unmodified during the TB translation */
+    uint64_t tbflags;  /* should stay unmodified during the TB translation */
     uint32_t envflags; /* should stay in sync with env->flags using TCG ops */
     int memidx;
     int gbank;
@@ -2177,7 +2177,7 @@ static void decode_gusa(DisasContext *ctx, CPUSH4State *env)
 static void sh4_tr_init_disas_context(DisasContextBase *dcbase, CPUState *cs)
 {
     DisasContext *ctx = container_of(dcbase, DisasContext, base);
-    uint32_t tbflags;
+    uint64_t tbflags;
     int bound;
 
     ctx->tbflags = tbflags = ctx->base.tb->flags;
-- 
2.55.0



^ permalink raw reply related	[flat|nested] 102+ messages in thread

* [PATCH 21/24] target/sparc: Use 64-bit TB flags
  2026-11-26 23:35 [PATCH 00/24] accel/tcg: Widen TranslationBlock::flags to 64 bits Philippe Mathieu-Daudé
                   ` (19 preceding siblings ...)
  2026-11-26 23:35 ` [PATCH 20/24] target/sh4: " Philippe Mathieu-Daudé
@ 2026-11-26 23:35 ` Philippe Mathieu-Daudé
  2026-11-27 11:30     ` Anton Johansson via
  2026-11-26 23:36 ` [PATCH 22/24] target/tricore: " Philippe Mathieu-Daudé
                   ` (2 subsequent siblings)
  23 siblings, 1 reply; 102+ messages in thread
From: Philippe Mathieu-Daudé @ 2026-11-26 23:35 UTC (permalink / raw)
  To: qemu-devel
  Cc: Richard Henderson, qemu-riscv, qemu-s390x, qemu-arm, qemu-ppc,
	Anton Johansson, Pierrick Bouvier, Philippe Mathieu-Daudé,
	Mark Cave-Ayland, Artyom Tarasenko

TranslationBlock::flags and TCGTBCPUState::flags are now
64-bit, use matching types for the values derived from them.

Signed-off-by: Philippe Mathieu-Daudé <philmd@oss.qualcomm.com>
---
 target/sparc/cpu.h | 4 ++--
 target/sparc/cpu.c | 4 ++--
 2 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/target/sparc/cpu.h b/target/sparc/cpu.h
index 3c1ba223eb25..4ac6e95307a4 100644
--- a/target/sparc/cpu.h
+++ b/target/sparc/cpu.h
@@ -742,7 +742,7 @@ trap_state* cpu_tsptr(CPUSPARCState* env);
 #define TB_FLAG_FSR_QNE      (1 << 8)
 #define TB_FLAG_ASI_SHIFT    24
 
-static inline bool tb_fpu_enabled(int tb_flags)
+static inline bool tb_fpu_enabled(uint64_t tb_flags)
 {
 #if defined(CONFIG_USER_ONLY)
     return true;
@@ -751,7 +751,7 @@ static inline bool tb_fpu_enabled(int tb_flags)
 #endif
 }
 
-static inline bool tb_am_enabled(int tb_flags)
+static inline bool tb_am_enabled(uint64_t tb_flags)
 {
 #ifndef TARGET_SPARC64
     return false;
diff --git a/target/sparc/cpu.c b/target/sparc/cpu.c
index 77294136988b..436e1ada97eb 100644
--- a/target/sparc/cpu.c
+++ b/target/sparc/cpu.c
@@ -723,7 +723,7 @@ static void sparc_cpu_synchronize_from_tb(CPUState *cs,
 static TCGTBCPUState sparc_get_tb_cpu_state(CPUState *cs)
 {
     CPUSPARCState *env = cpu_env(cs);
-    uint32_t flags = cpu_mmu_index(cs, false);
+    uint64_t flags = cpu_mmu_index(cs, false);
 
 #ifndef CONFIG_USER_ONLY
     if (cpu_supervisor_mode(env)) {
@@ -742,7 +742,7 @@ static TCGTBCPUState sparc_get_tb_cpu_state(CPUState *cs)
     if ((env->pstate & PS_PEF) && (env->fprs & FPRS_FEF)) {
         flags |= TB_FLAG_FPU_ENABLED;
     }
-    flags |= env->asi << TB_FLAG_ASI_SHIFT;
+    flags |= (uint64_t)env->asi << TB_FLAG_ASI_SHIFT;
 #else
     if (env->psref) {
         flags |= TB_FLAG_FPU_ENABLED;
-- 
2.55.0



^ permalink raw reply related	[flat|nested] 102+ messages in thread

* [PATCH 22/24] target/tricore: Use 64-bit TB flags
  2026-11-26 23:35 [PATCH 00/24] accel/tcg: Widen TranslationBlock::flags to 64 bits Philippe Mathieu-Daudé
                   ` (20 preceding siblings ...)
  2026-11-26 23:35 ` [PATCH 21/24] target/sparc: " Philippe Mathieu-Daudé
@ 2026-11-26 23:36 ` Philippe Mathieu-Daudé
  2026-11-27 11:31     ` Anton Johansson via
  2026-11-26 23:36 ` [PATCH 23/24] target/xtensa: " Philippe Mathieu-Daudé
  2026-11-26 23:36 ` [PATCH 24/24] accel/tcg: Update TranslationBlock::cs_base description Philippe Mathieu-Daudé
  23 siblings, 1 reply; 102+ messages in thread
From: Philippe Mathieu-Daudé @ 2026-11-26 23:36 UTC (permalink / raw)
  To: qemu-devel
  Cc: Richard Henderson, qemu-riscv, qemu-s390x, qemu-arm, qemu-ppc,
	Anton Johansson, Pierrick Bouvier, Philippe Mathieu-Daudé

TranslationBlock::flags and TCGTBCPUState::flags are now
64-bit, use matching types for the values derived from them.

Signed-off-by: Philippe Mathieu-Daudé <philmd@oss.qualcomm.com>
---
 target/tricore/cpu.c       | 2 +-
 target/tricore/translate.c | 4 ++--
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/target/tricore/cpu.c b/target/tricore/cpu.c
index fa782f82f00e..b77ad96fe7bb 100644
--- a/target/tricore/cpu.c
+++ b/target/tricore/cpu.c
@@ -81,7 +81,7 @@ static TCGTBCPUState tricore_get_tb_cpu_state(CPUState *cs)
 
     return (TCGTBCPUState){
         .pc = env->PC,
-        .flags = FIELD_DP32(0, TB_FLAGS, PRIV, extract32(env->PSW, 10, 2)),
+        .flags = FIELD_DP64(0, TB_FLAGS, PRIV, extract32(env->PSW, 10, 2)),
     };
 }
 
diff --git a/target/tricore/translate.c b/target/tricore/translate.c
index 8cd6b58f66be..7f343d5626e6 100644
--- a/target/tricore/translate.c
+++ b/target/tricore/translate.c
@@ -8389,8 +8389,8 @@ static void tricore_tr_init_disas_context(DisasContextBase *dcbase,
     CPUTriCoreState *env = cpu_env(cs);
     ctx->mem_idx = cpu_mmu_index(cs, false);
 
-    uint32_t tb_flags = (uint32_t)ctx->base.tb->flags;
-    ctx->priv = FIELD_EX32(tb_flags, TB_FLAGS, PRIV);
+    uint64_t tb_flags = ctx->base.tb->flags;
+    ctx->priv = FIELD_EX64(tb_flags, TB_FLAGS, PRIV);
 
     ctx->features = env->features;
     if (has_feature(ctx, TRICORE_FEATURE_161)) {
-- 
2.55.0



^ permalink raw reply related	[flat|nested] 102+ messages in thread

* [PATCH 23/24] target/xtensa: Use 64-bit TB flags
  2026-11-26 23:35 [PATCH 00/24] accel/tcg: Widen TranslationBlock::flags to 64 bits Philippe Mathieu-Daudé
                   ` (21 preceding siblings ...)
  2026-11-26 23:36 ` [PATCH 22/24] target/tricore: " Philippe Mathieu-Daudé
@ 2026-11-26 23:36 ` Philippe Mathieu-Daudé
  2026-11-27 11:32     ` Anton Johansson via
  2026-11-26 23:36 ` [PATCH 24/24] accel/tcg: Update TranslationBlock::cs_base description Philippe Mathieu-Daudé
  23 siblings, 1 reply; 102+ messages in thread
From: Philippe Mathieu-Daudé @ 2026-11-26 23:36 UTC (permalink / raw)
  To: qemu-devel
  Cc: Richard Henderson, qemu-riscv, qemu-s390x, qemu-arm, qemu-ppc,
	Anton Johansson, Pierrick Bouvier, Philippe Mathieu-Daudé,
	Max Filippov

TranslationBlock::flags and TCGTBCPUState::flags are now
64-bit, use matching types for the values derived from them.

Signed-off-by: Philippe Mathieu-Daudé <philmd@oss.qualcomm.com>
---
 target/xtensa/cpu.c       | 2 +-
 target/xtensa/translate.c | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/target/xtensa/cpu.c b/target/xtensa/cpu.c
index c193396928f9..33054c81ca48 100644
--- a/target/xtensa/cpu.c
+++ b/target/xtensa/cpu.c
@@ -60,7 +60,7 @@ static vaddr xtensa_cpu_get_pc(CPUState *cs)
 static TCGTBCPUState xtensa_get_tb_cpu_state(CPUState *cs)
 {
     CPUXtensaState *env = cpu_env(cs);
-    uint32_t flags = 0;
+    uint64_t flags = 0;
     uint64_t cs_base = 0;
 
     flags |= xtensa_get_ring(env);
diff --git a/target/xtensa/translate.c b/target/xtensa/translate.c
index 175fd4b5cfc2..57392ffd8319 100644
--- a/target/xtensa/translate.c
+++ b/target/xtensa/translate.c
@@ -1121,7 +1121,7 @@ static void xtensa_tr_init_disas_context(DisasContextBase *dcbase,
                                          CPUState *cpu)
 {
     DisasContext *dc = container_of(dcbase, DisasContext, base);
-    uint32_t tb_flags = dc->base.tb->flags;
+    uint64_t tb_flags = dc->base.tb->flags;
 
     dc->config = cpu_env(cpu)->config;
     dc->pc = dc->base.pc_first;
-- 
2.55.0



^ permalink raw reply related	[flat|nested] 102+ messages in thread

* [PATCH 24/24] accel/tcg: Update TranslationBlock::cs_base description
  2026-11-26 23:35 [PATCH 00/24] accel/tcg: Widen TranslationBlock::flags to 64 bits Philippe Mathieu-Daudé
                   ` (22 preceding siblings ...)
  2026-11-26 23:36 ` [PATCH 23/24] target/xtensa: " Philippe Mathieu-Daudé
@ 2026-11-26 23:36 ` Philippe Mathieu-Daudé
  2026-11-27 11:34     ` Anton Johansson via
  23 siblings, 1 reply; 102+ messages in thread
From: Philippe Mathieu-Daudé @ 2026-11-26 23:36 UTC (permalink / raw)
  To: qemu-devel
  Cc: Richard Henderson, qemu-riscv, qemu-s390x, qemu-arm, qemu-ppc,
	Anton Johansson, Pierrick Bouvier, Philippe Mathieu-Daudé

Describe the current TranslationBlock::cs_base users.

Commits that introduced target use of cs_base:
  arm:        a378206a205a target/arm: Move mode specific TB flags to tb->cs_base
  hppa:       c301f34e798e target/hppa: Implement IASQ
              ebd0e151149a target/hppa: Include priv level in user-only iaoq
  microblaze: d7ecb757d199 target/microblaze: Ensure imm constant is always available
  riscv:      55b490b58fbf target/riscv: Record misa_ext in TCGTBCPUState.cs_base
              1c88ab9e77bd target/riscv: Use the tb->cs_base as the extend tb flags
  s390x:      303c681a8f50 target/s390x: Implement EXECUTE via new TranslationBlock
  sh4:        4bfa602bc222 target/sh4: Handle user-space atomics
  sparc:      b453b70bd8e6 sparc fixes (first commit matching cs_base = env->npc)
  xtensa:     5d630cef4f91 target/xtensa: rework zero overhead loops implementation

Signed-off-by: Philippe Mathieu-Daudé <philmd@oss.qualcomm.com>
---
 include/exec/translation-block.h | 15 +++++++++++----
 1 file changed, 11 insertions(+), 4 deletions(-)

diff --git a/include/exec/translation-block.h b/include/exec/translation-block.h
index 491de24d71b9..8fca1bd92267 100644
--- a/include/exec/translation-block.h
+++ b/include/exec/translation-block.h
@@ -60,12 +60,19 @@ struct TranslationBlock {
     vaddr pc;
 
     /*
-     * Target-specific data associated with the TranslationBlock, e.g.:
-     * x86: the original user, the Code Segment virtual base,
-     * arm: an extension of tb->flags,
+     * cs_base: target-specific data associated with the TranslationBlock,
+     * as returned by cpu_get_tb_cpu_state() and part of the lookup key.
+     *
+     * Targets using it:
+     * x86: the Code Segment virtual base (0 in 64-bit mode),
+     * arm: an extension of tb->flags (CPUARMTBFlags::flags2),
+     * hppa: the CS_BASE_DIFF* bits and the IAOQ_B page offset,
+     * microblaze: the IMM prefix value,
+     * riscv: misa_ext (lookup key only, not read by the translator),
      * s390x: instruction data for EXECUTE,
+     * sh4: r0 (gUSA region end) when in a gUSA sequence (user-only),
      * sparc: the next pc of the instruction queue (for delay slots),
-     * riscv: misa_ext.
+     * xtensa: zero-overhead loop end distance and loop begin offset.
      */
     uint64_t cs_base;
 
-- 
2.55.0



^ permalink raw reply related	[flat|nested] 102+ messages in thread

* Re: [PATCH 07/24] target/hexagon: Use 64-bit TB flags
  2026-11-26 23:35 ` [PATCH 07/24] target/hexagon: " Philippe Mathieu-Daudé
@ 2026-11-27  4:56   ` Brian Cain
  2026-12-01  2:22   ` Brian Cain
  1 sibling, 0 replies; 102+ messages in thread
From: Brian Cain @ 2026-11-27  4:56 UTC (permalink / raw)
  To: Philippe Mathieu-Daudé, qemu-devel
  Cc: Richard Henderson, qemu-riscv, qemu-s390x, qemu-arm, qemu-ppc,
	Anton Johansson, Pierrick Bouvier


On 11/26/2026 5:35 PM, Philippe Mathieu-Daudé wrote:
> TranslationBlock::flags and TCGTBCPUState::flags are now
> 64-bit, use matching types for the values derived from them.
>
> Signed-off-by: Philippe Mathieu-Daudé <philmd@oss.qualcomm.com>
> ---
>   target/hexagon/cpu.c       | 16 ++++++++--------
>   target/hexagon/translate.c | 14 +++++++-------
>   2 files changed, 15 insertions(+), 15 deletions(-)

Reviewed-by: Brian Cain <brian.cain@oss.qualcomm.com>




^ permalink raw reply	[flat|nested] 102+ messages in thread

* Re: [PATCH 15/24] target/ppc: Use 64-bit TB flags
  2026-11-26 23:35 ` [PATCH 15/24] target/ppc: " Philippe Mathieu-Daudé
@ 2026-11-27  7:57   ` Chinmay Rath
  2026-11-27 12:09     ` Philippe Mathieu-Daudé
  0 siblings, 1 reply; 102+ messages in thread
From: Chinmay Rath @ 2026-11-27  7:57 UTC (permalink / raw)
  To: Philippe Mathieu-Daudé, qemu-devel
  Cc: Richard Henderson, qemu-riscv, qemu-s390x, qemu-arm, qemu-ppc,
	Anton Johansson, Pierrick Bouvier, Nicholas Piggin, Glenn Miles,
	Harsh Prateek Bora


On 11/27/26 05:05, Philippe Mathieu-Daudé wrote:
> TranslationBlock::flags and TCGTBCPUState::flags are now
> 64-bit, use matching types for the values derived from them.
>
> Signed-off-by: Philippe Mathieu-Daudé <philmd@oss.qualcomm.com>
Hi Philippe,
Few months back I was wondering why cs_base was used as an extension 
instead of extending flags to 64 bits. With this series, now I 
understand that it was to support 32 bit hosts. Thanks for that!

I was wondering if PPC env's internal hflags should also be extended to 
64 bits with this, but I guess that can wait for when we actually have 
more than 32 bits needed there.
With that,

Reviewed-by: Chinmay Rath <rathc@linux.ibm.com>
> ---
>   target/ppc/translate.c | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/target/ppc/translate.c b/target/ppc/translate.c
> index dccae25bb4ec..e7bb0e4d4667 100644
> --- a/target/ppc/translate.c
> +++ b/target/ppc/translate.c
> @@ -4996,7 +4996,7 @@ static void ppc_tr_init_disas_context(DisasContextBase *dcbase, CPUState *cs)
>   {
>       DisasContext *ctx = container_of(dcbase, DisasContext, base);
>       CPUPPCState *env = cpu_env(cs);
> -    uint32_t hflags = ctx->base.tb->flags;
> +    uint64_t hflags = ctx->base.tb->flags;
>   
>       ctx->spr_cb = env->spr_cb;
>       ctx->pr = (hflags >> HFLAGS_PR) & 1;


^ permalink raw reply	[flat|nested] 102+ messages in thread

* Re: [PATCH 01/24] target/arm: Widen CPUARMTBFlags::flags to 64 bits
  2026-11-26 23:35 ` [PATCH 01/24] target/arm: Widen CPUARMTBFlags::flags " Philippe Mathieu-Daudé
  2026-11-27  9:58     ` Anton Johansson via
@ 2026-11-27  9:58     ` Anton Johansson via
  0 siblings, 0 replies; 102+ messages in thread
From: Anton Johansson via @ 2026-11-27  9:58 UTC (permalink / raw)
  To: Philippe Mathieu-Daudé
  Cc: qemu-devel, Richard Henderson, qemu-riscv, qemu-s390x, qemu-arm,
	qemu-ppc, Pierrick Bouvier, Peter Maydell

On 27/11/26, Philippe Mathieu-Daudé wrote:
> Use the 64-bit field accessors for TBFLAG_ANY and print the value
> with PRIx64. Prepare for TranslationBlock::flags becoming 64-bit.
> 
> Signed-off-by: Philippe Mathieu-Daudé <philmd@oss.qualcomm.com>
> ---
>  target/arm/cpu.h        | 12 ++++++------
>  target/arm/tcg/hflags.c |  4 ++--
>  2 files changed, 8 insertions(+), 8 deletions(-)

Reviewed-by: Anton Johansson <anjo@rev.ng>


^ permalink raw reply	[flat|nested] 102+ messages in thread

* Re: [PATCH 01/24] target/arm: Widen CPUARMTBFlags::flags to 64 bits
@ 2026-11-27  9:58     ` Anton Johansson via
  0 siblings, 0 replies; 102+ messages in thread
From: Anton Johansson via @ 2026-11-27  9:58 UTC (permalink / raw)
  To: Philippe Mathieu-Daudé
  Cc: qemu-devel, Richard Henderson, qemu-riscv, qemu-s390x, qemu-arm,
	qemu-ppc, Pierrick Bouvier, Peter Maydell

On 27/11/26, Philippe Mathieu-Daudé wrote:
> Use the 64-bit field accessors for TBFLAG_ANY and print the value
> with PRIx64. Prepare for TranslationBlock::flags becoming 64-bit.
> 
> Signed-off-by: Philippe Mathieu-Daudé <philmd@oss.qualcomm.com>
> ---
>  target/arm/cpu.h        | 12 ++++++------
>  target/arm/tcg/hflags.c |  4 ++--
>  2 files changed, 8 insertions(+), 8 deletions(-)

Reviewed-by: Anton Johansson <anjo@rev.ng>


^ permalink raw reply	[flat|nested] 102+ messages in thread

* Re: [PATCH 01/24] target/arm: Widen CPUARMTBFlags::flags to 64 bits
@ 2026-11-27  9:58     ` Anton Johansson via
  0 siblings, 0 replies; 102+ messages in thread
From: Anton Johansson via qemu development @ 2026-11-27  9:58 UTC (permalink / raw)
  To: Philippe Mathieu-Daudé
  Cc: qemu-devel, Richard Henderson, qemu-riscv, qemu-s390x, qemu-arm,
	qemu-ppc, Pierrick Bouvier, Peter Maydell

On 27/11/26, Philippe Mathieu-Daudé wrote:
> Use the 64-bit field accessors for TBFLAG_ANY and print the value
> with PRIx64. Prepare for TranslationBlock::flags becoming 64-bit.
> 
> Signed-off-by: Philippe Mathieu-Daudé <philmd@oss.qualcomm.com>
> ---
>  target/arm/cpu.h        | 12 ++++++------
>  target/arm/tcg/hflags.c |  4 ++--
>  2 files changed, 8 insertions(+), 8 deletions(-)

Reviewed-by: Anton Johansson <anjo@rev.ng>


^ permalink raw reply	[flat|nested] 102+ messages in thread

* Re: [PATCH 02/24] accel/tcg: Update stale TranslationBlock::jmp_lock comment
  2026-11-26 23:35 ` [PATCH 02/24] accel/tcg: Update stale TranslationBlock::jmp_lock comment Philippe Mathieu-Daudé
  2026-11-27  9:59     ` Anton Johansson via
@ 2026-11-27  9:59     ` Anton Johansson via
  0 siblings, 0 replies; 102+ messages in thread
From: Anton Johansson via @ 2026-11-27  9:59 UTC (permalink / raw)
  To: Philippe Mathieu-Daudé
  Cc: qemu-devel, Richard Henderson, qemu-riscv, qemu-s390x, qemu-arm,
	qemu-ppc, Pierrick Bouvier

On 27/11/26, Philippe Mathieu-Daudé wrote:
> jmp_lock was placed to fill a 4-byte hole, but commit 9da6079b2695
> ("tcg: Add TranslationBlock.jmp_insn_offset") added jmp_insn_offset[],
> so jmp_lock, jmp_reset_offset[] and jmp_insn_offset[] now take 12
> bytes, leaving a 4-byte hole after jmp_insn_offset.
> 
> Signed-off-by: Philippe Mathieu-Daudé <philmd@oss.qualcomm.com>
> ---
>  include/exec/translation-block.h | 6 +++++-

Reviewed-by: Anton Johansson <anjo@rev.ng>


^ permalink raw reply	[flat|nested] 102+ messages in thread

* Re: [PATCH 02/24] accel/tcg: Update stale TranslationBlock::jmp_lock comment
@ 2026-11-27  9:59     ` Anton Johansson via
  0 siblings, 0 replies; 102+ messages in thread
From: Anton Johansson via @ 2026-11-27  9:59 UTC (permalink / raw)
  To: Philippe Mathieu-Daudé
  Cc: qemu-devel, Richard Henderson, qemu-riscv, qemu-s390x, qemu-arm,
	qemu-ppc, Pierrick Bouvier

On 27/11/26, Philippe Mathieu-Daudé wrote:
> jmp_lock was placed to fill a 4-byte hole, but commit 9da6079b2695
> ("tcg: Add TranslationBlock.jmp_insn_offset") added jmp_insn_offset[],
> so jmp_lock, jmp_reset_offset[] and jmp_insn_offset[] now take 12
> bytes, leaving a 4-byte hole after jmp_insn_offset.
> 
> Signed-off-by: Philippe Mathieu-Daudé <philmd@oss.qualcomm.com>
> ---
>  include/exec/translation-block.h | 6 +++++-

Reviewed-by: Anton Johansson <anjo@rev.ng>


^ permalink raw reply	[flat|nested] 102+ messages in thread

* Re: [PATCH 02/24] accel/tcg: Update stale TranslationBlock::jmp_lock comment
@ 2026-11-27  9:59     ` Anton Johansson via
  0 siblings, 0 replies; 102+ messages in thread
From: Anton Johansson via qemu development @ 2026-11-27  9:59 UTC (permalink / raw)
  To: Philippe Mathieu-Daudé
  Cc: qemu-devel, Richard Henderson, qemu-riscv, qemu-s390x, qemu-arm,
	qemu-ppc, Pierrick Bouvier

On 27/11/26, Philippe Mathieu-Daudé wrote:
> jmp_lock was placed to fill a 4-byte hole, but commit 9da6079b2695
> ("tcg: Add TranslationBlock.jmp_insn_offset") added jmp_insn_offset[],
> so jmp_lock, jmp_reset_offset[] and jmp_insn_offset[] now take 12
> bytes, leaving a 4-byte hole after jmp_insn_offset.
> 
> Signed-off-by: Philippe Mathieu-Daudé <philmd@oss.qualcomm.com>
> ---
>  include/exec/translation-block.h | 6 +++++-

Reviewed-by: Anton Johansson <anjo@rev.ng>


^ permalink raw reply	[flat|nested] 102+ messages in thread

* Re: [PATCH 03/24] accel/tcg: Widen TranslationBlock::flags to 64 bits
  2026-11-26 23:35 ` [PATCH 03/24] accel/tcg: Widen TranslationBlock::flags to 64 bits Philippe Mathieu-Daudé
  2026-11-27 11:03     ` Anton Johansson via
@ 2026-11-27 11:03     ` Anton Johansson via
  0 siblings, 0 replies; 102+ messages in thread
From: Anton Johansson via qemu development @ 2026-11-27 11:03 UTC (permalink / raw)
  To: Philippe Mathieu-Daudé
  Cc: qemu-devel, Richard Henderson, qemu-riscv, qemu-s390x, qemu-arm,
	qemu-ppc, Pierrick Bouvier, Paolo Bonzini

On 27/11/26, Philippe Mathieu-Daudé wrote:
> 32-bit host support was removed in v11.0.0 (with commit 372ec46b9f
> "meson: Reject 32-bit hosts"), so there is no reason to keep the TB
> flags 32-bit. The wider field fills the 4-byte hole between icount
> and tc, leaving sizeof(TranslationBlock) unchanged. Widen
> TCGTBCPUState::flags too.
> 
> Feed the upper 32 bits into the TB hash, and adapt format string.
> 
> Signed-off-by: Philippe Mathieu-Daudé <philmd@oss.qualcomm.com>
> ---
>  accel/tcg/tb-hash.h              | 5 +++--
>  include/accel/tcg/tb-cpu-state.h | 2 +-
>  include/exec/translation-block.h | 2 +-
>  accel/tcg/cpu-exec.c             | 2 +-
>  4 files changed, 6 insertions(+), 5 deletions(-)
> 
> diff --git a/accel/tcg/tb-hash.h b/accel/tcg/tb-hash.h
> index f7b159f04cb6..819b594618aa 100644
> --- a/accel/tcg/tb-hash.h
> +++ b/accel/tcg/tb-hash.h
> @@ -63,9 +63,10 @@ static inline unsigned int tb_jmp_cache_hash_func(vaddr pc)
>  
>  static inline
>  uint32_t tb_hash_func(tb_page_addr_t phys_pc, vaddr pc,
> -                      uint32_t flags, uint64_t flags2, uint32_t cf_mask)
> +                      uint64_t flags, uint64_t flags2, uint32_t cf_mask)
>  {
> -    return qemu_xxhash8(phys_pc, pc, flags2, flags, cf_mask);
> +    /* Fold the upper flag bits into the cf_mask slot. */
> +    return qemu_xxhash8(phys_pc, pc, flags2, flags, cf_mask ^ (flags >> 32));
>  }

From what I can tell, while cf_mask ^ (flags >> 32) does increase the
probability for hash collisions it should still be extremely rare.
Currently the only possibility for extra collision is with the riscv ALTFMT,
BIG_ENDIAN, SDEXT_STEP fields and CF_COUNT_MASK, from what I can tell.

IMO, for the time being this wouldn't cause any real performance issues
compared to say adding an extra word to qemu_xxhash8().

Reviewed-by: Anton Johansson <anjo@rev.ng>


^ permalink raw reply	[flat|nested] 102+ messages in thread

* Re: [PATCH 03/24] accel/tcg: Widen TranslationBlock::flags to 64 bits
@ 2026-11-27 11:03     ` Anton Johansson via
  0 siblings, 0 replies; 102+ messages in thread
From: Anton Johansson via @ 2026-11-27 11:03 UTC (permalink / raw)
  To: Philippe Mathieu-Daudé
  Cc: qemu-devel, Richard Henderson, qemu-riscv, qemu-s390x, qemu-arm,
	qemu-ppc, Pierrick Bouvier, Paolo Bonzini

On 27/11/26, Philippe Mathieu-Daudé wrote:
> 32-bit host support was removed in v11.0.0 (with commit 372ec46b9f
> "meson: Reject 32-bit hosts"), so there is no reason to keep the TB
> flags 32-bit. The wider field fills the 4-byte hole between icount
> and tc, leaving sizeof(TranslationBlock) unchanged. Widen
> TCGTBCPUState::flags too.
> 
> Feed the upper 32 bits into the TB hash, and adapt format string.
> 
> Signed-off-by: Philippe Mathieu-Daudé <philmd@oss.qualcomm.com>
> ---
>  accel/tcg/tb-hash.h              | 5 +++--
>  include/accel/tcg/tb-cpu-state.h | 2 +-
>  include/exec/translation-block.h | 2 +-
>  accel/tcg/cpu-exec.c             | 2 +-
>  4 files changed, 6 insertions(+), 5 deletions(-)
> 
> diff --git a/accel/tcg/tb-hash.h b/accel/tcg/tb-hash.h
> index f7b159f04cb6..819b594618aa 100644
> --- a/accel/tcg/tb-hash.h
> +++ b/accel/tcg/tb-hash.h
> @@ -63,9 +63,10 @@ static inline unsigned int tb_jmp_cache_hash_func(vaddr pc)
>  
>  static inline
>  uint32_t tb_hash_func(tb_page_addr_t phys_pc, vaddr pc,
> -                      uint32_t flags, uint64_t flags2, uint32_t cf_mask)
> +                      uint64_t flags, uint64_t flags2, uint32_t cf_mask)
>  {
> -    return qemu_xxhash8(phys_pc, pc, flags2, flags, cf_mask);
> +    /* Fold the upper flag bits into the cf_mask slot. */
> +    return qemu_xxhash8(phys_pc, pc, flags2, flags, cf_mask ^ (flags >> 32));
>  }

From what I can tell, while cf_mask ^ (flags >> 32) does increase the
probability for hash collisions it should still be extremely rare.
Currently the only possibility for extra collision is with the riscv ALTFMT,
BIG_ENDIAN, SDEXT_STEP fields and CF_COUNT_MASK, from what I can tell.

IMO, for the time being this wouldn't cause any real performance issues
compared to say adding an extra word to qemu_xxhash8().

Reviewed-by: Anton Johansson <anjo@rev.ng>


^ permalink raw reply	[flat|nested] 102+ messages in thread

* Re: [PATCH 03/24] accel/tcg: Widen TranslationBlock::flags to 64 bits
@ 2026-11-27 11:03     ` Anton Johansson via
  0 siblings, 0 replies; 102+ messages in thread
From: Anton Johansson via @ 2026-11-27 11:03 UTC (permalink / raw)
  To: Philippe Mathieu-Daudé
  Cc: qemu-devel, Richard Henderson, qemu-riscv, qemu-s390x, qemu-arm,
	qemu-ppc, Pierrick Bouvier, Paolo Bonzini

On 27/11/26, Philippe Mathieu-Daudé wrote:
> 32-bit host support was removed in v11.0.0 (with commit 372ec46b9f
> "meson: Reject 32-bit hosts"), so there is no reason to keep the TB
> flags 32-bit. The wider field fills the 4-byte hole between icount
> and tc, leaving sizeof(TranslationBlock) unchanged. Widen
> TCGTBCPUState::flags too.
> 
> Feed the upper 32 bits into the TB hash, and adapt format string.
> 
> Signed-off-by: Philippe Mathieu-Daudé <philmd@oss.qualcomm.com>
> ---
>  accel/tcg/tb-hash.h              | 5 +++--
>  include/accel/tcg/tb-cpu-state.h | 2 +-
>  include/exec/translation-block.h | 2 +-
>  accel/tcg/cpu-exec.c             | 2 +-
>  4 files changed, 6 insertions(+), 5 deletions(-)
> 
> diff --git a/accel/tcg/tb-hash.h b/accel/tcg/tb-hash.h
> index f7b159f04cb6..819b594618aa 100644
> --- a/accel/tcg/tb-hash.h
> +++ b/accel/tcg/tb-hash.h
> @@ -63,9 +63,10 @@ static inline unsigned int tb_jmp_cache_hash_func(vaddr pc)
>  
>  static inline
>  uint32_t tb_hash_func(tb_page_addr_t phys_pc, vaddr pc,
> -                      uint32_t flags, uint64_t flags2, uint32_t cf_mask)
> +                      uint64_t flags, uint64_t flags2, uint32_t cf_mask)
>  {
> -    return qemu_xxhash8(phys_pc, pc, flags2, flags, cf_mask);
> +    /* Fold the upper flag bits into the cf_mask slot. */
> +    return qemu_xxhash8(phys_pc, pc, flags2, flags, cf_mask ^ (flags >> 32));
>  }

From what I can tell, while cf_mask ^ (flags >> 32) does increase the
probability for hash collisions it should still be extremely rare.
Currently the only possibility for extra collision is with the riscv ALTFMT,
BIG_ENDIAN, SDEXT_STEP fields and CF_COUNT_MASK, from what I can tell.

IMO, for the time being this wouldn't cause any real performance issues
compared to say adding an extra word to qemu_xxhash8().

Reviewed-by: Anton Johansson <anjo@rev.ng>


^ permalink raw reply	[flat|nested] 102+ messages in thread

* Re: [PATCH 04/24] target/arm: Update TB flags split comment for 64-bit tb->flags
  2026-11-26 23:35 ` [PATCH 04/24] target/arm: Update TB flags split comment for 64-bit tb->flags Philippe Mathieu-Daudé
  2026-11-27 11:09     ` Anton Johansson via
@ 2026-11-27 11:09     ` Anton Johansson via
  0 siblings, 0 replies; 102+ messages in thread
From: Anton Johansson via @ 2026-11-27 11:09 UTC (permalink / raw)
  To: Philippe Mathieu-Daudé
  Cc: qemu-devel, Richard Henderson, qemu-riscv, qemu-s390x, qemu-arm,
	qemu-ppc, Pierrick Bouvier, Peter Maydell

On 27/11/26, Philippe Mathieu-Daudé wrote:
> TranslationBlock::flags is now 64-bit, but AArch64 needs
> TBFLAG_ANY (15 bits) plus TBFLAG_A64 (51 bits), so the split
> with tb->cs_base is still required.
> 
> Signed-off-by: Philippe Mathieu-Daudé <philmd@oss.qualcomm.com>
> ---
>  target/arm/cpu.h | 5 +++--
>  1 file changed, 3 insertions(+), 2 deletions(-)
> 
> diff --git a/target/arm/cpu.h b/target/arm/cpu.h
> index 5ee9ebf352fb..59e44b76a08a 100644
> --- a/target/arm/cpu.h
> +++ b/target/arm/cpu.h
> @@ -2484,8 +2484,9 @@ static inline bool arm_sctlr_b(const CPUARMState *env)
>  uint64_t arm_sctlr(CPUARMState *env, int el);
>  
>  /*
> - * We have more than 32-bits worth of state per TB, so we split the data
> - * between tb->flags and tb->cs_base, which is otherwise unused for ARM.
> + * We have more than 64-bits worth of state per TB (AArch64 needs
> + * TBFLAG_ANY (15 bits) plus TBFLAG_A64 (51 bits)), so we split the data
> + * between tb->flags and tb->cs_base.
>   * We collect these two parts in CPUARMTBFlags where they are named
>   * flags and flags2 respectively.
>   *
> -- 
> 2.55.0
> 
> 

Reviewed-by: Anton Johansson <anjo@rev.ng>


^ permalink raw reply	[flat|nested] 102+ messages in thread

* Re: [PATCH 04/24] target/arm: Update TB flags split comment for 64-bit tb->flags
@ 2026-11-27 11:09     ` Anton Johansson via
  0 siblings, 0 replies; 102+ messages in thread
From: Anton Johansson via @ 2026-11-27 11:09 UTC (permalink / raw)
  To: Philippe Mathieu-Daudé
  Cc: qemu-devel, Richard Henderson, qemu-riscv, qemu-s390x, qemu-arm,
	qemu-ppc, Pierrick Bouvier, Peter Maydell

On 27/11/26, Philippe Mathieu-Daudé wrote:
> TranslationBlock::flags is now 64-bit, but AArch64 needs
> TBFLAG_ANY (15 bits) plus TBFLAG_A64 (51 bits), so the split
> with tb->cs_base is still required.
> 
> Signed-off-by: Philippe Mathieu-Daudé <philmd@oss.qualcomm.com>
> ---
>  target/arm/cpu.h | 5 +++--
>  1 file changed, 3 insertions(+), 2 deletions(-)
> 
> diff --git a/target/arm/cpu.h b/target/arm/cpu.h
> index 5ee9ebf352fb..59e44b76a08a 100644
> --- a/target/arm/cpu.h
> +++ b/target/arm/cpu.h
> @@ -2484,8 +2484,9 @@ static inline bool arm_sctlr_b(const CPUARMState *env)
>  uint64_t arm_sctlr(CPUARMState *env, int el);
>  
>  /*
> - * We have more than 32-bits worth of state per TB, so we split the data
> - * between tb->flags and tb->cs_base, which is otherwise unused for ARM.
> + * We have more than 64-bits worth of state per TB (AArch64 needs
> + * TBFLAG_ANY (15 bits) plus TBFLAG_A64 (51 bits)), so we split the data
> + * between tb->flags and tb->cs_base.
>   * We collect these two parts in CPUARMTBFlags where they are named
>   * flags and flags2 respectively.
>   *
> -- 
> 2.55.0
> 
> 

Reviewed-by: Anton Johansson <anjo@rev.ng>


^ permalink raw reply	[flat|nested] 102+ messages in thread

* Re: [PATCH 04/24] target/arm: Update TB flags split comment for 64-bit tb->flags
@ 2026-11-27 11:09     ` Anton Johansson via
  0 siblings, 0 replies; 102+ messages in thread
From: Anton Johansson via qemu development @ 2026-11-27 11:09 UTC (permalink / raw)
  To: Philippe Mathieu-Daudé
  Cc: qemu-devel, Richard Henderson, qemu-riscv, qemu-s390x, qemu-arm,
	qemu-ppc, Pierrick Bouvier, Peter Maydell

On 27/11/26, Philippe Mathieu-Daudé wrote:
> TranslationBlock::flags is now 64-bit, but AArch64 needs
> TBFLAG_ANY (15 bits) plus TBFLAG_A64 (51 bits), so the split
> with tb->cs_base is still required.
> 
> Signed-off-by: Philippe Mathieu-Daudé <philmd@oss.qualcomm.com>
> ---
>  target/arm/cpu.h | 5 +++--
>  1 file changed, 3 insertions(+), 2 deletions(-)
> 
> diff --git a/target/arm/cpu.h b/target/arm/cpu.h
> index 5ee9ebf352fb..59e44b76a08a 100644
> --- a/target/arm/cpu.h
> +++ b/target/arm/cpu.h
> @@ -2484,8 +2484,9 @@ static inline bool arm_sctlr_b(const CPUARMState *env)
>  uint64_t arm_sctlr(CPUARMState *env, int el);
>  
>  /*
> - * We have more than 32-bits worth of state per TB, so we split the data
> - * between tb->flags and tb->cs_base, which is otherwise unused for ARM.
> + * We have more than 64-bits worth of state per TB (AArch64 needs
> + * TBFLAG_ANY (15 bits) plus TBFLAG_A64 (51 bits)), so we split the data
> + * between tb->flags and tb->cs_base.
>   * We collect these two parts in CPUARMTBFlags where they are named
>   * flags and flags2 respectively.
>   *
> -- 
> 2.55.0
> 
> 

Reviewed-by: Anton Johansson <anjo@rev.ng>


^ permalink raw reply	[flat|nested] 102+ messages in thread

* Re: [PATCH 05/24] target/alpha: Use 64-bit TB flags
  2026-11-26 23:35 ` [PATCH 05/24] target/alpha: Use 64-bit TB flags Philippe Mathieu-Daudé
  2026-11-27 11:11     ` Anton Johansson via qemu development
@ 2026-11-27 11:11     ` Anton Johansson via qemu development
  0 siblings, 0 replies; 102+ messages in thread
From: Anton Johansson via @ 2026-11-27 11:11 UTC (permalink / raw)
  To: Philippe Mathieu-Daudé
  Cc: qemu-devel, Richard Henderson, qemu-riscv, qemu-s390x, qemu-arm,
	qemu-ppc, Pierrick Bouvier

On 27/11/26, Philippe Mathieu-Daudé wrote:
> TranslationBlock::flags and TCGTBCPUState::flags are now
> 64-bit, use matching types for the values derived from them.
> 
> Signed-off-by: Philippe Mathieu-Daudé <philmd@oss.qualcomm.com>
> ---
>  target/alpha/cpu.c       | 2 +-
>  target/alpha/translate.c | 2 +-
>  2 files changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/target/alpha/cpu.c b/target/alpha/cpu.c
> index fd099c8e70f9..de452c881172 100644
> --- a/target/alpha/cpu.c
> +++ b/target/alpha/cpu.c
> @@ -44,7 +44,7 @@ static vaddr alpha_cpu_get_pc(CPUState *cs)
>  static TCGTBCPUState alpha_get_tb_cpu_state(CPUState *cs)
>  {
>      CPUAlphaState *env = cpu_env(cs);
> -    uint32_t flags = env->flags & ENV_FLAG_TB_MASK;
> +    uint64_t flags = env->flags & ENV_FLAG_TB_MASK;
>  
>  #ifdef CONFIG_USER_ONLY
>      flags |= TB_FLAG_UNALIGN * !cs->prctl_unalign_sigbus;
> diff --git a/target/alpha/translate.c b/target/alpha/translate.c
> index 6f18b8d1af62..2063abf3ce5a 100644
> --- a/target/alpha/translate.c
> +++ b/target/alpha/translate.c
> @@ -48,7 +48,7 @@ struct DisasContext {
>  #ifdef CONFIG_USER_ONLY
>      MemOp unalign;
>  #endif
> -    uint32_t tbflags;
> +    uint64_t tbflags;
>      int mem_idx;
>  
>      /* True if generating pc-relative code.  */
> -- 
> 2.55.0
> 

Reviewed-by: Anton Johansson <anjo@rev.ng>


^ permalink raw reply	[flat|nested] 102+ messages in thread

* Re: [PATCH 05/24] target/alpha: Use 64-bit TB flags
@ 2026-11-27 11:11     ` Anton Johansson via qemu development
  0 siblings, 0 replies; 102+ messages in thread
From: Anton Johansson via qemu development @ 2026-11-27 11:11 UTC (permalink / raw)
  To: Philippe Mathieu-Daudé
  Cc: qemu-devel, Richard Henderson, qemu-riscv, qemu-s390x, qemu-arm,
	qemu-ppc, Pierrick Bouvier

On 27/11/26, Philippe Mathieu-Daudé wrote:
> TranslationBlock::flags and TCGTBCPUState::flags are now
> 64-bit, use matching types for the values derived from them.
> 
> Signed-off-by: Philippe Mathieu-Daudé <philmd@oss.qualcomm.com>
> ---
>  target/alpha/cpu.c       | 2 +-
>  target/alpha/translate.c | 2 +-
>  2 files changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/target/alpha/cpu.c b/target/alpha/cpu.c
> index fd099c8e70f9..de452c881172 100644
> --- a/target/alpha/cpu.c
> +++ b/target/alpha/cpu.c
> @@ -44,7 +44,7 @@ static vaddr alpha_cpu_get_pc(CPUState *cs)
>  static TCGTBCPUState alpha_get_tb_cpu_state(CPUState *cs)
>  {
>      CPUAlphaState *env = cpu_env(cs);
> -    uint32_t flags = env->flags & ENV_FLAG_TB_MASK;
> +    uint64_t flags = env->flags & ENV_FLAG_TB_MASK;
>  
>  #ifdef CONFIG_USER_ONLY
>      flags |= TB_FLAG_UNALIGN * !cs->prctl_unalign_sigbus;
> diff --git a/target/alpha/translate.c b/target/alpha/translate.c
> index 6f18b8d1af62..2063abf3ce5a 100644
> --- a/target/alpha/translate.c
> +++ b/target/alpha/translate.c
> @@ -48,7 +48,7 @@ struct DisasContext {
>  #ifdef CONFIG_USER_ONLY
>      MemOp unalign;
>  #endif
> -    uint32_t tbflags;
> +    uint64_t tbflags;
>      int mem_idx;
>  
>      /* True if generating pc-relative code.  */
> -- 
> 2.55.0
> 

Reviewed-by: Anton Johansson <anjo@rev.ng>


^ permalink raw reply	[flat|nested] 102+ messages in thread

* Re: [PATCH 05/24] target/alpha: Use 64-bit TB flags
@ 2026-11-27 11:11     ` Anton Johansson via qemu development
  0 siblings, 0 replies; 102+ messages in thread
From: Anton Johansson via @ 2026-11-27 11:11 UTC (permalink / raw)
  To: Philippe Mathieu-Daudé
  Cc: qemu-devel, Richard Henderson, qemu-riscv, qemu-s390x, qemu-arm,
	qemu-ppc, Pierrick Bouvier

On 27/11/26, Philippe Mathieu-Daudé wrote:
> TranslationBlock::flags and TCGTBCPUState::flags are now
> 64-bit, use matching types for the values derived from them.
> 
> Signed-off-by: Philippe Mathieu-Daudé <philmd@oss.qualcomm.com>
> ---
>  target/alpha/cpu.c       | 2 +-
>  target/alpha/translate.c | 2 +-
>  2 files changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/target/alpha/cpu.c b/target/alpha/cpu.c
> index fd099c8e70f9..de452c881172 100644
> --- a/target/alpha/cpu.c
> +++ b/target/alpha/cpu.c
> @@ -44,7 +44,7 @@ static vaddr alpha_cpu_get_pc(CPUState *cs)
>  static TCGTBCPUState alpha_get_tb_cpu_state(CPUState *cs)
>  {
>      CPUAlphaState *env = cpu_env(cs);
> -    uint32_t flags = env->flags & ENV_FLAG_TB_MASK;
> +    uint64_t flags = env->flags & ENV_FLAG_TB_MASK;
>  
>  #ifdef CONFIG_USER_ONLY
>      flags |= TB_FLAG_UNALIGN * !cs->prctl_unalign_sigbus;
> diff --git a/target/alpha/translate.c b/target/alpha/translate.c
> index 6f18b8d1af62..2063abf3ce5a 100644
> --- a/target/alpha/translate.c
> +++ b/target/alpha/translate.c
> @@ -48,7 +48,7 @@ struct DisasContext {
>  #ifdef CONFIG_USER_ONLY
>      MemOp unalign;
>  #endif
> -    uint32_t tbflags;
> +    uint64_t tbflags;
>      int mem_idx;
>  
>      /* True if generating pc-relative code.  */
> -- 
> 2.55.0
> 

Reviewed-by: Anton Johansson <anjo@rev.ng>


^ permalink raw reply	[flat|nested] 102+ messages in thread

* Re: [PATCH 06/24] target/avr: Use 64-bit TB flags
  2026-11-26 23:35 ` [PATCH 06/24] target/avr: " Philippe Mathieu-Daudé
  2026-11-27 11:12     ` Anton Johansson via
@ 2026-11-27 11:12     ` Anton Johansson via
  0 siblings, 0 replies; 102+ messages in thread
From: Anton Johansson via qemu development @ 2026-11-27 11:12 UTC (permalink / raw)
  To: Philippe Mathieu-Daudé
  Cc: qemu-devel, Richard Henderson, qemu-riscv, qemu-s390x, qemu-arm,
	qemu-ppc, Pierrick Bouvier, Michael Rolnik

On 27/11/26, Philippe Mathieu-Daudé wrote:
> TranslationBlock::flags and TCGTBCPUState::flags are now
> 64-bit, use matching types for the values derived from them.
> 
> Signed-off-by: Philippe Mathieu-Daudé <philmd@oss.qualcomm.com>
> ---
>  target/avr/cpu.c       | 2 +-
>  target/avr/translate.c | 2 +-
>  2 files changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/target/avr/cpu.c b/target/avr/cpu.c
> index 83710f565182..689d3f6ac5f5 100644
> --- a/target/avr/cpu.c
> +++ b/target/avr/cpu.c
> @@ -58,7 +58,7 @@ static int avr_cpu_mmu_index(CPUState *cs, bool ifetch)
>  static TCGTBCPUState avr_get_tb_cpu_state(CPUState *cs)
>  {
>      CPUAVRState *env = cpu_env(cs);
> -    uint32_t flags = 0;
> +    uint64_t flags = 0;
>  
>      if (env->fullacc) {
>          flags |= TB_FLAGS_FULL_ACCESS;
> diff --git a/target/avr/translate.c b/target/avr/translate.c
> index 3c5760609702..6a4e36f326af 100644
> --- a/target/avr/translate.c
> +++ b/target/avr/translate.c
> @@ -2660,7 +2660,7 @@ static bool canonicalize_skip(DisasContext *ctx)
>  static void avr_tr_init_disas_context(DisasContextBase *dcbase, CPUState *cs)
>  {
>      DisasContext *ctx = container_of(dcbase, DisasContext, base);
> -    uint32_t tb_flags = ctx->base.tb->flags;
> +    uint64_t tb_flags = ctx->base.tb->flags;
>  
>      ctx->cs = cs;
>      ctx->env = cpu_env(cs);
> -- 
> 2.55.0
> 

Reviewed-by: Anton Johansson <anjo@rev.ng>


^ permalink raw reply	[flat|nested] 102+ messages in thread

* Re: [PATCH 06/24] target/avr: Use 64-bit TB flags
@ 2026-11-27 11:12     ` Anton Johansson via
  0 siblings, 0 replies; 102+ messages in thread
From: Anton Johansson via @ 2026-11-27 11:12 UTC (permalink / raw)
  To: Philippe Mathieu-Daudé
  Cc: qemu-devel, Richard Henderson, qemu-riscv, qemu-s390x, qemu-arm,
	qemu-ppc, Pierrick Bouvier, Michael Rolnik

On 27/11/26, Philippe Mathieu-Daudé wrote:
> TranslationBlock::flags and TCGTBCPUState::flags are now
> 64-bit, use matching types for the values derived from them.
> 
> Signed-off-by: Philippe Mathieu-Daudé <philmd@oss.qualcomm.com>
> ---
>  target/avr/cpu.c       | 2 +-
>  target/avr/translate.c | 2 +-
>  2 files changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/target/avr/cpu.c b/target/avr/cpu.c
> index 83710f565182..689d3f6ac5f5 100644
> --- a/target/avr/cpu.c
> +++ b/target/avr/cpu.c
> @@ -58,7 +58,7 @@ static int avr_cpu_mmu_index(CPUState *cs, bool ifetch)
>  static TCGTBCPUState avr_get_tb_cpu_state(CPUState *cs)
>  {
>      CPUAVRState *env = cpu_env(cs);
> -    uint32_t flags = 0;
> +    uint64_t flags = 0;
>  
>      if (env->fullacc) {
>          flags |= TB_FLAGS_FULL_ACCESS;
> diff --git a/target/avr/translate.c b/target/avr/translate.c
> index 3c5760609702..6a4e36f326af 100644
> --- a/target/avr/translate.c
> +++ b/target/avr/translate.c
> @@ -2660,7 +2660,7 @@ static bool canonicalize_skip(DisasContext *ctx)
>  static void avr_tr_init_disas_context(DisasContextBase *dcbase, CPUState *cs)
>  {
>      DisasContext *ctx = container_of(dcbase, DisasContext, base);
> -    uint32_t tb_flags = ctx->base.tb->flags;
> +    uint64_t tb_flags = ctx->base.tb->flags;
>  
>      ctx->cs = cs;
>      ctx->env = cpu_env(cs);
> -- 
> 2.55.0
> 

Reviewed-by: Anton Johansson <anjo@rev.ng>


^ permalink raw reply	[flat|nested] 102+ messages in thread

* Re: [PATCH 06/24] target/avr: Use 64-bit TB flags
@ 2026-11-27 11:12     ` Anton Johansson via
  0 siblings, 0 replies; 102+ messages in thread
From: Anton Johansson via @ 2026-11-27 11:12 UTC (permalink / raw)
  To: Philippe Mathieu-Daudé
  Cc: qemu-devel, Richard Henderson, qemu-riscv, qemu-s390x, qemu-arm,
	qemu-ppc, Pierrick Bouvier, Michael Rolnik

On 27/11/26, Philippe Mathieu-Daudé wrote:
> TranslationBlock::flags and TCGTBCPUState::flags are now
> 64-bit, use matching types for the values derived from them.
> 
> Signed-off-by: Philippe Mathieu-Daudé <philmd@oss.qualcomm.com>
> ---
>  target/avr/cpu.c       | 2 +-
>  target/avr/translate.c | 2 +-
>  2 files changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/target/avr/cpu.c b/target/avr/cpu.c
> index 83710f565182..689d3f6ac5f5 100644
> --- a/target/avr/cpu.c
> +++ b/target/avr/cpu.c
> @@ -58,7 +58,7 @@ static int avr_cpu_mmu_index(CPUState *cs, bool ifetch)
>  static TCGTBCPUState avr_get_tb_cpu_state(CPUState *cs)
>  {
>      CPUAVRState *env = cpu_env(cs);
> -    uint32_t flags = 0;
> +    uint64_t flags = 0;
>  
>      if (env->fullacc) {
>          flags |= TB_FLAGS_FULL_ACCESS;
> diff --git a/target/avr/translate.c b/target/avr/translate.c
> index 3c5760609702..6a4e36f326af 100644
> --- a/target/avr/translate.c
> +++ b/target/avr/translate.c
> @@ -2660,7 +2660,7 @@ static bool canonicalize_skip(DisasContext *ctx)
>  static void avr_tr_init_disas_context(DisasContextBase *dcbase, CPUState *cs)
>  {
>      DisasContext *ctx = container_of(dcbase, DisasContext, base);
> -    uint32_t tb_flags = ctx->base.tb->flags;
> +    uint64_t tb_flags = ctx->base.tb->flags;
>  
>      ctx->cs = cs;
>      ctx->env = cpu_env(cs);
> -- 
> 2.55.0
> 

Reviewed-by: Anton Johansson <anjo@rev.ng>


^ permalink raw reply	[flat|nested] 102+ messages in thread

* Re: [PATCH 08/24] target/hppa: Use 64-bit TB flags
  2026-11-26 23:35 ` [PATCH 08/24] target/hppa: " Philippe Mathieu-Daudé
  2026-11-27 11:13     ` Anton Johansson via
@ 2026-11-27 11:13     ` Anton Johansson via
  0 siblings, 0 replies; 102+ messages in thread
From: Anton Johansson via qemu development @ 2026-11-27 11:13 UTC (permalink / raw)
  To: Philippe Mathieu-Daudé
  Cc: qemu-devel, Richard Henderson, qemu-riscv, qemu-s390x, qemu-arm,
	qemu-ppc, Pierrick Bouvier, Helge Deller

On 27/11/26, Philippe Mathieu-Daudé wrote:
> TranslationBlock::flags and TCGTBCPUState::flags are now
> 64-bit, use matching types for the values derived from them.
> 
> Signed-off-by: Philippe Mathieu-Daudé <philmd@oss.qualcomm.com>
> ---
>  target/hppa/cpu.c       | 2 +-
>  target/hppa/translate.c | 2 +-
>  2 files changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/target/hppa/cpu.c b/target/hppa/cpu.c
> index 83104ae0c70f..2e30451f85ad 100644
> --- a/target/hppa/cpu.c
> +++ b/target/hppa/cpu.c
> @@ -56,7 +56,7 @@ static vaddr hppa_cpu_get_pc(CPUState *cs)
>  static TCGTBCPUState hppa_get_tb_cpu_state(CPUState *cs)
>  {
>      CPUHPPAState *env = cpu_env(cs);
> -    uint32_t flags = 0;
> +    uint64_t flags = 0;
>      uint64_t cs_base = 0;
>      vaddr pc;
>  
> diff --git a/target/hppa/translate.c b/target/hppa/translate.c
> index ab3505f9c973..16bd0808bb40 100644
> --- a/target/hppa/translate.c
> +++ b/target/hppa/translate.c
> @@ -82,7 +82,7 @@ typedef struct DisasContext {
>      TCGv_i64 zero;
>  
>      uint32_t insn;
> -    uint32_t tb_flags;
> +    uint64_t tb_flags;
>      int mmu_idx;
>      int privilege;
>      uint32_t psw_xb;
> -- 
> 2.55.0
> 
> 

Reviewed-by: Anton Johansson <anjo@rev.ng>


^ permalink raw reply	[flat|nested] 102+ messages in thread

* Re: [PATCH 08/24] target/hppa: Use 64-bit TB flags
@ 2026-11-27 11:13     ` Anton Johansson via
  0 siblings, 0 replies; 102+ messages in thread
From: Anton Johansson via @ 2026-11-27 11:13 UTC (permalink / raw)
  To: Philippe Mathieu-Daudé
  Cc: qemu-devel, Richard Henderson, qemu-riscv, qemu-s390x, qemu-arm,
	qemu-ppc, Pierrick Bouvier, Helge Deller

On 27/11/26, Philippe Mathieu-Daudé wrote:
> TranslationBlock::flags and TCGTBCPUState::flags are now
> 64-bit, use matching types for the values derived from them.
> 
> Signed-off-by: Philippe Mathieu-Daudé <philmd@oss.qualcomm.com>
> ---
>  target/hppa/cpu.c       | 2 +-
>  target/hppa/translate.c | 2 +-
>  2 files changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/target/hppa/cpu.c b/target/hppa/cpu.c
> index 83104ae0c70f..2e30451f85ad 100644
> --- a/target/hppa/cpu.c
> +++ b/target/hppa/cpu.c
> @@ -56,7 +56,7 @@ static vaddr hppa_cpu_get_pc(CPUState *cs)
>  static TCGTBCPUState hppa_get_tb_cpu_state(CPUState *cs)
>  {
>      CPUHPPAState *env = cpu_env(cs);
> -    uint32_t flags = 0;
> +    uint64_t flags = 0;
>      uint64_t cs_base = 0;
>      vaddr pc;
>  
> diff --git a/target/hppa/translate.c b/target/hppa/translate.c
> index ab3505f9c973..16bd0808bb40 100644
> --- a/target/hppa/translate.c
> +++ b/target/hppa/translate.c
> @@ -82,7 +82,7 @@ typedef struct DisasContext {
>      TCGv_i64 zero;
>  
>      uint32_t insn;
> -    uint32_t tb_flags;
> +    uint64_t tb_flags;
>      int mmu_idx;
>      int privilege;
>      uint32_t psw_xb;
> -- 
> 2.55.0
> 
> 

Reviewed-by: Anton Johansson <anjo@rev.ng>


^ permalink raw reply	[flat|nested] 102+ messages in thread

* Re: [PATCH 08/24] target/hppa: Use 64-bit TB flags
@ 2026-11-27 11:13     ` Anton Johansson via
  0 siblings, 0 replies; 102+ messages in thread
From: Anton Johansson via @ 2026-11-27 11:13 UTC (permalink / raw)
  To: Philippe Mathieu-Daudé
  Cc: qemu-devel, Richard Henderson, qemu-riscv, qemu-s390x, qemu-arm,
	qemu-ppc, Pierrick Bouvier, Helge Deller

On 27/11/26, Philippe Mathieu-Daudé wrote:
> TranslationBlock::flags and TCGTBCPUState::flags are now
> 64-bit, use matching types for the values derived from them.
> 
> Signed-off-by: Philippe Mathieu-Daudé <philmd@oss.qualcomm.com>
> ---
>  target/hppa/cpu.c       | 2 +-
>  target/hppa/translate.c | 2 +-
>  2 files changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/target/hppa/cpu.c b/target/hppa/cpu.c
> index 83104ae0c70f..2e30451f85ad 100644
> --- a/target/hppa/cpu.c
> +++ b/target/hppa/cpu.c
> @@ -56,7 +56,7 @@ static vaddr hppa_cpu_get_pc(CPUState *cs)
>  static TCGTBCPUState hppa_get_tb_cpu_state(CPUState *cs)
>  {
>      CPUHPPAState *env = cpu_env(cs);
> -    uint32_t flags = 0;
> +    uint64_t flags = 0;
>      uint64_t cs_base = 0;
>      vaddr pc;
>  
> diff --git a/target/hppa/translate.c b/target/hppa/translate.c
> index ab3505f9c973..16bd0808bb40 100644
> --- a/target/hppa/translate.c
> +++ b/target/hppa/translate.c
> @@ -82,7 +82,7 @@ typedef struct DisasContext {
>      TCGv_i64 zero;
>  
>      uint32_t insn;
> -    uint32_t tb_flags;
> +    uint64_t tb_flags;
>      int mmu_idx;
>      int privilege;
>      uint32_t psw_xb;
> -- 
> 2.55.0
> 
> 

Reviewed-by: Anton Johansson <anjo@rev.ng>


^ permalink raw reply	[flat|nested] 102+ messages in thread

* Re: [PATCH 09/24] target/i386: Use 64-bit TB flags
  2026-11-26 23:35 ` [PATCH 09/24] target/i386: " Philippe Mathieu-Daudé
  2026-11-27 11:14     ` Anton Johansson via
@ 2026-11-27 11:14     ` Anton Johansson via
  0 siblings, 0 replies; 102+ messages in thread
From: Anton Johansson via qemu development @ 2026-11-27 11:14 UTC (permalink / raw)
  To: Philippe Mathieu-Daudé
  Cc: qemu-devel, Richard Henderson, qemu-riscv, qemu-s390x, qemu-arm,
	qemu-ppc, Pierrick Bouvier, Paolo Bonzini

On 27/11/26, Philippe Mathieu-Daudé wrote:
> TranslationBlock::flags and TCGTBCPUState::flags are now
> 64-bit, use matching types for the values derived from them.
> 
> Signed-off-by: Philippe Mathieu-Daudé <philmd@oss.qualcomm.com>
> ---
>  target/i386/tcg/tcg-cpu.c   | 3 ++-
>  target/i386/tcg/translate.c | 4 ++--
>  2 files changed, 4 insertions(+), 3 deletions(-)
> 
> diff --git a/target/i386/tcg/tcg-cpu.c b/target/i386/tcg/tcg-cpu.c
> index 167ff7695ae6..bdfd08107d6a 100644
> --- a/target/i386/tcg/tcg-cpu.c
> +++ b/target/i386/tcg/tcg-cpu.c
> @@ -53,7 +53,8 @@ static void x86_cpu_exec_exit(CPUState *cs)
>  static TCGTBCPUState x86_get_tb_cpu_state(CPUState *cs)
>  {
>      CPUX86State *env = cpu_env(cs);
> -    uint32_t flags, cs_base;
> +    uint64_t flags;
> +    uint32_t cs_base;
>      vaddr pc;
>  
>      flags = env->hflags |
> diff --git a/target/i386/tcg/translate.c b/target/i386/tcg/translate.c
> index 719771032ff5..af98125cd718 100644
> --- a/target/i386/tcg/translate.c
> +++ b/target/i386/tcg/translate.c
> @@ -122,7 +122,7 @@ typedef struct DisasContext {
>  
>      CCOp cc_op;  /* current CC operation */
>      int mem_index; /* select memory access functions */
> -    uint32_t flags; /* all execution flags */
> +    uint64_t flags; /* all execution flags */
>      int cpuid_features;
>      int cpuid_ext_features;
>      int cpuid_ext2_features;
> @@ -3535,7 +3535,7 @@ static void i386_tr_init_disas_context(DisasContextBase *dcbase, CPUState *cpu)
>  {
>      DisasContext *dc = container_of(dcbase, DisasContext, base);
>      CPUX86State *env = cpu_env(cpu);
> -    uint32_t flags = dc->base.tb->flags;
> +    uint64_t flags = dc->base.tb->flags;
>      uint32_t cflags = tb_cflags(dc->base.tb);
>      int cpl = (flags >> HF_CPL_SHIFT) & 3;
>      int iopl = (flags >> IOPL_SHIFT) & 3;
> -- 
> 2.55.0
> 
> 

Reviewed-by: Anton Johansson <anjo@rev.ng>


^ permalink raw reply	[flat|nested] 102+ messages in thread

* Re: [PATCH 09/24] target/i386: Use 64-bit TB flags
@ 2026-11-27 11:14     ` Anton Johansson via
  0 siblings, 0 replies; 102+ messages in thread
From: Anton Johansson via @ 2026-11-27 11:14 UTC (permalink / raw)
  To: Philippe Mathieu-Daudé
  Cc: qemu-devel, Richard Henderson, qemu-riscv, qemu-s390x, qemu-arm,
	qemu-ppc, Pierrick Bouvier, Paolo Bonzini

On 27/11/26, Philippe Mathieu-Daudé wrote:
> TranslationBlock::flags and TCGTBCPUState::flags are now
> 64-bit, use matching types for the values derived from them.
> 
> Signed-off-by: Philippe Mathieu-Daudé <philmd@oss.qualcomm.com>
> ---
>  target/i386/tcg/tcg-cpu.c   | 3 ++-
>  target/i386/tcg/translate.c | 4 ++--
>  2 files changed, 4 insertions(+), 3 deletions(-)
> 
> diff --git a/target/i386/tcg/tcg-cpu.c b/target/i386/tcg/tcg-cpu.c
> index 167ff7695ae6..bdfd08107d6a 100644
> --- a/target/i386/tcg/tcg-cpu.c
> +++ b/target/i386/tcg/tcg-cpu.c
> @@ -53,7 +53,8 @@ static void x86_cpu_exec_exit(CPUState *cs)
>  static TCGTBCPUState x86_get_tb_cpu_state(CPUState *cs)
>  {
>      CPUX86State *env = cpu_env(cs);
> -    uint32_t flags, cs_base;
> +    uint64_t flags;
> +    uint32_t cs_base;
>      vaddr pc;
>  
>      flags = env->hflags |
> diff --git a/target/i386/tcg/translate.c b/target/i386/tcg/translate.c
> index 719771032ff5..af98125cd718 100644
> --- a/target/i386/tcg/translate.c
> +++ b/target/i386/tcg/translate.c
> @@ -122,7 +122,7 @@ typedef struct DisasContext {
>  
>      CCOp cc_op;  /* current CC operation */
>      int mem_index; /* select memory access functions */
> -    uint32_t flags; /* all execution flags */
> +    uint64_t flags; /* all execution flags */
>      int cpuid_features;
>      int cpuid_ext_features;
>      int cpuid_ext2_features;
> @@ -3535,7 +3535,7 @@ static void i386_tr_init_disas_context(DisasContextBase *dcbase, CPUState *cpu)
>  {
>      DisasContext *dc = container_of(dcbase, DisasContext, base);
>      CPUX86State *env = cpu_env(cpu);
> -    uint32_t flags = dc->base.tb->flags;
> +    uint64_t flags = dc->base.tb->flags;
>      uint32_t cflags = tb_cflags(dc->base.tb);
>      int cpl = (flags >> HF_CPL_SHIFT) & 3;
>      int iopl = (flags >> IOPL_SHIFT) & 3;
> -- 
> 2.55.0
> 
> 

Reviewed-by: Anton Johansson <anjo@rev.ng>


^ permalink raw reply	[flat|nested] 102+ messages in thread

* Re: [PATCH 09/24] target/i386: Use 64-bit TB flags
@ 2026-11-27 11:14     ` Anton Johansson via
  0 siblings, 0 replies; 102+ messages in thread
From: Anton Johansson via @ 2026-11-27 11:14 UTC (permalink / raw)
  To: Philippe Mathieu-Daudé
  Cc: qemu-devel, Richard Henderson, qemu-riscv, qemu-s390x, qemu-arm,
	qemu-ppc, Pierrick Bouvier, Paolo Bonzini

On 27/11/26, Philippe Mathieu-Daudé wrote:
> TranslationBlock::flags and TCGTBCPUState::flags are now
> 64-bit, use matching types for the values derived from them.
> 
> Signed-off-by: Philippe Mathieu-Daudé <philmd@oss.qualcomm.com>
> ---
>  target/i386/tcg/tcg-cpu.c   | 3 ++-
>  target/i386/tcg/translate.c | 4 ++--
>  2 files changed, 4 insertions(+), 3 deletions(-)
> 
> diff --git a/target/i386/tcg/tcg-cpu.c b/target/i386/tcg/tcg-cpu.c
> index 167ff7695ae6..bdfd08107d6a 100644
> --- a/target/i386/tcg/tcg-cpu.c
> +++ b/target/i386/tcg/tcg-cpu.c
> @@ -53,7 +53,8 @@ static void x86_cpu_exec_exit(CPUState *cs)
>  static TCGTBCPUState x86_get_tb_cpu_state(CPUState *cs)
>  {
>      CPUX86State *env = cpu_env(cs);
> -    uint32_t flags, cs_base;
> +    uint64_t flags;
> +    uint32_t cs_base;
>      vaddr pc;
>  
>      flags = env->hflags |
> diff --git a/target/i386/tcg/translate.c b/target/i386/tcg/translate.c
> index 719771032ff5..af98125cd718 100644
> --- a/target/i386/tcg/translate.c
> +++ b/target/i386/tcg/translate.c
> @@ -122,7 +122,7 @@ typedef struct DisasContext {
>  
>      CCOp cc_op;  /* current CC operation */
>      int mem_index; /* select memory access functions */
> -    uint32_t flags; /* all execution flags */
> +    uint64_t flags; /* all execution flags */
>      int cpuid_features;
>      int cpuid_ext_features;
>      int cpuid_ext2_features;
> @@ -3535,7 +3535,7 @@ static void i386_tr_init_disas_context(DisasContextBase *dcbase, CPUState *cpu)
>  {
>      DisasContext *dc = container_of(dcbase, DisasContext, base);
>      CPUX86State *env = cpu_env(cpu);
> -    uint32_t flags = dc->base.tb->flags;
> +    uint64_t flags = dc->base.tb->flags;
>      uint32_t cflags = tb_cflags(dc->base.tb);
>      int cpl = (flags >> HF_CPL_SHIFT) & 3;
>      int iopl = (flags >> IOPL_SHIFT) & 3;
> -- 
> 2.55.0
> 
> 

Reviewed-by: Anton Johansson <anjo@rev.ng>


^ permalink raw reply	[flat|nested] 102+ messages in thread

* Re: [PATCH 10/24] target/loongarch: Use 64-bit TB flags
  2026-11-26 23:35 ` [PATCH 10/24] target/loongarch: " Philippe Mathieu-Daudé
  2026-11-27 11:16     ` Anton Johansson via
@ 2026-11-27 11:16     ` Anton Johansson via
  1 sibling, 0 replies; 102+ messages in thread
From: Anton Johansson via qemu development @ 2026-11-27 11:16 UTC (permalink / raw)
  To: Philippe Mathieu-Daudé
  Cc: qemu-devel, Richard Henderson, qemu-riscv, qemu-s390x, qemu-arm,
	qemu-ppc, Pierrick Bouvier, Song Gao, Bibo Mao, Xianglai Li

On 27/11/26, Philippe Mathieu-Daudé wrote:
> TranslationBlock::flags and TCGTBCPUState::flags are now
> 64-bit, use matching types for the values derived from them.
> 
> Signed-off-by: Philippe Mathieu-Daudé <philmd@oss.qualcomm.com>
> ---
>  target/loongarch/tcg/tcg_cpu.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/target/loongarch/tcg/tcg_cpu.c b/target/loongarch/tcg/tcg_cpu.c
> index 0549506035f3..743b682f1fb0 100644
> --- a/target/loongarch/tcg/tcg_cpu.c
> +++ b/target/loongarch/tcg/tcg_cpu.c
> @@ -236,7 +236,7 @@ static TCGTBCPUState loongarch_get_tb_cpu_state(CPUState *cs)
>  {
>      CPULoongArchState *env = cpu_env(cs);
>      CPUSysState *sys = env_sys(env);
> -    uint32_t flags;
> +    uint64_t flags;
>  
>      flags = sys->CSR_CRMD & (R_CSR_CRMD_PLV_MASK | R_CSR_CRMD_PG_MASK);
>      flags |= FIELD_EX64(sys->CSR_EUEN, CSR_EUEN, FPE) * HW_FLAGS_EUEN_FPE;
> -- 
> 2.55.0
> 

Reviewed-by: Anton Johansson <anjo@rev.ng>


^ permalink raw reply	[flat|nested] 102+ messages in thread

* Re: [PATCH 10/24] target/loongarch: Use 64-bit TB flags
@ 2026-11-27 11:16     ` Anton Johansson via
  0 siblings, 0 replies; 102+ messages in thread
From: Anton Johansson via @ 2026-11-27 11:16 UTC (permalink / raw)
  To: Philippe Mathieu-Daudé
  Cc: qemu-devel, Richard Henderson, qemu-riscv, qemu-s390x, qemu-arm,
	qemu-ppc, Pierrick Bouvier, Song Gao, Bibo Mao, Xianglai Li

On 27/11/26, Philippe Mathieu-Daudé wrote:
> TranslationBlock::flags and TCGTBCPUState::flags are now
> 64-bit, use matching types for the values derived from them.
> 
> Signed-off-by: Philippe Mathieu-Daudé <philmd@oss.qualcomm.com>
> ---
>  target/loongarch/tcg/tcg_cpu.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/target/loongarch/tcg/tcg_cpu.c b/target/loongarch/tcg/tcg_cpu.c
> index 0549506035f3..743b682f1fb0 100644
> --- a/target/loongarch/tcg/tcg_cpu.c
> +++ b/target/loongarch/tcg/tcg_cpu.c
> @@ -236,7 +236,7 @@ static TCGTBCPUState loongarch_get_tb_cpu_state(CPUState *cs)
>  {
>      CPULoongArchState *env = cpu_env(cs);
>      CPUSysState *sys = env_sys(env);
> -    uint32_t flags;
> +    uint64_t flags;
>  
>      flags = sys->CSR_CRMD & (R_CSR_CRMD_PLV_MASK | R_CSR_CRMD_PG_MASK);
>      flags |= FIELD_EX64(sys->CSR_EUEN, CSR_EUEN, FPE) * HW_FLAGS_EUEN_FPE;
> -- 
> 2.55.0
> 

Reviewed-by: Anton Johansson <anjo@rev.ng>


^ permalink raw reply	[flat|nested] 102+ messages in thread

* Re: [PATCH 10/24] target/loongarch: Use 64-bit TB flags
@ 2026-11-27 11:16     ` Anton Johansson via
  0 siblings, 0 replies; 102+ messages in thread
From: Anton Johansson via @ 2026-11-27 11:16 UTC (permalink / raw)
  To: Philippe Mathieu-Daudé
  Cc: qemu-devel, Richard Henderson, qemu-riscv, qemu-s390x, qemu-arm,
	qemu-ppc, Pierrick Bouvier, Song Gao, Bibo Mao, Xianglai Li

On 27/11/26, Philippe Mathieu-Daudé wrote:
> TranslationBlock::flags and TCGTBCPUState::flags are now
> 64-bit, use matching types for the values derived from them.
> 
> Signed-off-by: Philippe Mathieu-Daudé <philmd@oss.qualcomm.com>
> ---
>  target/loongarch/tcg/tcg_cpu.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/target/loongarch/tcg/tcg_cpu.c b/target/loongarch/tcg/tcg_cpu.c
> index 0549506035f3..743b682f1fb0 100644
> --- a/target/loongarch/tcg/tcg_cpu.c
> +++ b/target/loongarch/tcg/tcg_cpu.c
> @@ -236,7 +236,7 @@ static TCGTBCPUState loongarch_get_tb_cpu_state(CPUState *cs)
>  {
>      CPULoongArchState *env = cpu_env(cs);
>      CPUSysState *sys = env_sys(env);
> -    uint32_t flags;
> +    uint64_t flags;
>  
>      flags = sys->CSR_CRMD & (R_CSR_CRMD_PLV_MASK | R_CSR_CRMD_PG_MASK);
>      flags |= FIELD_EX64(sys->CSR_EUEN, CSR_EUEN, FPE) * HW_FLAGS_EUEN_FPE;
> -- 
> 2.55.0
> 

Reviewed-by: Anton Johansson <anjo@rev.ng>


^ permalink raw reply	[flat|nested] 102+ messages in thread

* Re: [PATCH 11/24] target/m68k: Use 64-bit TB flags
  2026-11-26 23:35 ` [PATCH 11/24] target/m68k: " Philippe Mathieu-Daudé
  2026-11-27 11:16     ` Anton Johansson via
@ 2026-11-27 11:16     ` Anton Johansson via
  0 siblings, 0 replies; 102+ messages in thread
From: Anton Johansson via qemu development @ 2026-11-27 11:16 UTC (permalink / raw)
  To: Philippe Mathieu-Daudé
  Cc: qemu-devel, Richard Henderson, qemu-riscv, qemu-s390x, qemu-arm,
	qemu-ppc, Pierrick Bouvier, Laurent Vivier

On 27/11/26, Philippe Mathieu-Daudé wrote:
> TranslationBlock::flags and TCGTBCPUState::flags are now
> 64-bit, use matching types for the values derived from them.
> 
> Signed-off-by: Philippe Mathieu-Daudé <philmd@oss.qualcomm.com>
> ---
>  target/m68k/cpu.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/target/m68k/cpu.c b/target/m68k/cpu.c
> index f7d289e591a2..74ac2a177cd5 100644
> --- a/target/m68k/cpu.c
> +++ b/target/m68k/cpu.c
> @@ -47,7 +47,7 @@ static vaddr m68k_cpu_get_pc(CPUState *cs)
>  static TCGTBCPUState m68k_get_tb_cpu_state(CPUState *cs)
>  {
>      CPUM68KState *env = cpu_env(cs);
> -    uint32_t flags;
> +    uint64_t flags;
>  
>      flags = (env->macsr >> 4) & TB_FLAGS_MACSR;
>      if (env->sr & SR_S) {
> -- 
> 2.55.0
> 
> 

Reviewed-by: Anton Johansson <anjo@rev.ng>


^ permalink raw reply	[flat|nested] 102+ messages in thread

* Re: [PATCH 11/24] target/m68k: Use 64-bit TB flags
@ 2026-11-27 11:16     ` Anton Johansson via
  0 siblings, 0 replies; 102+ messages in thread
From: Anton Johansson via @ 2026-11-27 11:16 UTC (permalink / raw)
  To: Philippe Mathieu-Daudé
  Cc: qemu-devel, Richard Henderson, qemu-riscv, qemu-s390x, qemu-arm,
	qemu-ppc, Pierrick Bouvier, Laurent Vivier

On 27/11/26, Philippe Mathieu-Daudé wrote:
> TranslationBlock::flags and TCGTBCPUState::flags are now
> 64-bit, use matching types for the values derived from them.
> 
> Signed-off-by: Philippe Mathieu-Daudé <philmd@oss.qualcomm.com>
> ---
>  target/m68k/cpu.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/target/m68k/cpu.c b/target/m68k/cpu.c
> index f7d289e591a2..74ac2a177cd5 100644
> --- a/target/m68k/cpu.c
> +++ b/target/m68k/cpu.c
> @@ -47,7 +47,7 @@ static vaddr m68k_cpu_get_pc(CPUState *cs)
>  static TCGTBCPUState m68k_get_tb_cpu_state(CPUState *cs)
>  {
>      CPUM68KState *env = cpu_env(cs);
> -    uint32_t flags;
> +    uint64_t flags;
>  
>      flags = (env->macsr >> 4) & TB_FLAGS_MACSR;
>      if (env->sr & SR_S) {
> -- 
> 2.55.0
> 
> 

Reviewed-by: Anton Johansson <anjo@rev.ng>


^ permalink raw reply	[flat|nested] 102+ messages in thread

* Re: [PATCH 11/24] target/m68k: Use 64-bit TB flags
@ 2026-11-27 11:16     ` Anton Johansson via
  0 siblings, 0 replies; 102+ messages in thread
From: Anton Johansson via @ 2026-11-27 11:16 UTC (permalink / raw)
  To: Philippe Mathieu-Daudé
  Cc: qemu-devel, Richard Henderson, qemu-riscv, qemu-s390x, qemu-arm,
	qemu-ppc, Pierrick Bouvier, Laurent Vivier

On 27/11/26, Philippe Mathieu-Daudé wrote:
> TranslationBlock::flags and TCGTBCPUState::flags are now
> 64-bit, use matching types for the values derived from them.
> 
> Signed-off-by: Philippe Mathieu-Daudé <philmd@oss.qualcomm.com>
> ---
>  target/m68k/cpu.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/target/m68k/cpu.c b/target/m68k/cpu.c
> index f7d289e591a2..74ac2a177cd5 100644
> --- a/target/m68k/cpu.c
> +++ b/target/m68k/cpu.c
> @@ -47,7 +47,7 @@ static vaddr m68k_cpu_get_pc(CPUState *cs)
>  static TCGTBCPUState m68k_get_tb_cpu_state(CPUState *cs)
>  {
>      CPUM68KState *env = cpu_env(cs);
> -    uint32_t flags;
> +    uint64_t flags;
>  
>      flags = (env->macsr >> 4) & TB_FLAGS_MACSR;
>      if (env->sr & SR_S) {
> -- 
> 2.55.0
> 
> 

Reviewed-by: Anton Johansson <anjo@rev.ng>


^ permalink raw reply	[flat|nested] 102+ messages in thread

* Re: [PATCH 12/24] target/microblaze: Use 64-bit TB flags
  2026-11-26 23:35 ` [PATCH 12/24] target/microblaze: " Philippe Mathieu-Daudé
  2026-11-27 11:17     ` Anton Johansson via qemu development
@ 2026-11-27 11:17     ` Anton Johansson via qemu development
  0 siblings, 0 replies; 102+ messages in thread
From: Anton Johansson via @ 2026-11-27 11:17 UTC (permalink / raw)
  To: Philippe Mathieu-Daudé
  Cc: qemu-devel, Richard Henderson, qemu-riscv, qemu-s390x, qemu-arm,
	qemu-ppc, Pierrick Bouvier, Edgar E. Iglesias

On 27/11/26, Philippe Mathieu-Daudé wrote:
> TranslationBlock::flags and TCGTBCPUState::flags are now
> 64-bit, use matching types for the values derived from them.
> 
> Signed-off-by: Philippe Mathieu-Daudé <philmd@oss.qualcomm.com>
> ---
>  target/microblaze/translate.c | 6 +++---
>  1 file changed, 3 insertions(+), 3 deletions(-)
> 
> diff --git a/target/microblaze/translate.c b/target/microblaze/translate.c
> index 8b219afb5dd4..4c869f77f5c0 100644
> --- a/target/microblaze/translate.c
> +++ b/target/microblaze/translate.c
> @@ -68,8 +68,8 @@ typedef struct DisasContext {
>  
>      /* Decoder.  */
>      uint32_t ext_imm;
> -    unsigned int tb_flags;
> -    unsigned int tb_flags_to_set;
> +    uint64_t tb_flags;
> +    uint64_t tb_flags_to_set;
>      int mem_index;
>  
>      /* Condition under which to jump, including NEVER and ALWAYS. */
> @@ -1668,7 +1668,7 @@ static void mb_tr_translate_insn(DisasContextBase *dcb, CPUState *cs)
>          /*
>           * Finish any return-from branch.
>           */
> -        uint32_t rt_ibe = dc->tb_flags & (DRTI_FLAG | DRTB_FLAG | DRTE_FLAG);
> +        uint64_t rt_ibe = dc->tb_flags & (DRTI_FLAG | DRTB_FLAG | DRTE_FLAG);
>          if (unlikely(rt_ibe != 0)) {
>              dc->tb_flags &= ~(DRTI_FLAG | DRTB_FLAG | DRTE_FLAG);
>              if (rt_ibe & DRTI_FLAG) {
> -- 
> 2.55.0
> 
> 

Reviewed-by: Anton Johansson <anjo@rev.ng>


^ permalink raw reply	[flat|nested] 102+ messages in thread

* Re: [PATCH 12/24] target/microblaze: Use 64-bit TB flags
@ 2026-11-27 11:17     ` Anton Johansson via qemu development
  0 siblings, 0 replies; 102+ messages in thread
From: Anton Johansson via qemu development @ 2026-11-27 11:17 UTC (permalink / raw)
  To: Philippe Mathieu-Daudé
  Cc: qemu-devel, Richard Henderson, qemu-riscv, qemu-s390x, qemu-arm,
	qemu-ppc, Pierrick Bouvier, Edgar E. Iglesias

On 27/11/26, Philippe Mathieu-Daudé wrote:
> TranslationBlock::flags and TCGTBCPUState::flags are now
> 64-bit, use matching types for the values derived from them.
> 
> Signed-off-by: Philippe Mathieu-Daudé <philmd@oss.qualcomm.com>
> ---
>  target/microblaze/translate.c | 6 +++---
>  1 file changed, 3 insertions(+), 3 deletions(-)
> 
> diff --git a/target/microblaze/translate.c b/target/microblaze/translate.c
> index 8b219afb5dd4..4c869f77f5c0 100644
> --- a/target/microblaze/translate.c
> +++ b/target/microblaze/translate.c
> @@ -68,8 +68,8 @@ typedef struct DisasContext {
>  
>      /* Decoder.  */
>      uint32_t ext_imm;
> -    unsigned int tb_flags;
> -    unsigned int tb_flags_to_set;
> +    uint64_t tb_flags;
> +    uint64_t tb_flags_to_set;
>      int mem_index;
>  
>      /* Condition under which to jump, including NEVER and ALWAYS. */
> @@ -1668,7 +1668,7 @@ static void mb_tr_translate_insn(DisasContextBase *dcb, CPUState *cs)
>          /*
>           * Finish any return-from branch.
>           */
> -        uint32_t rt_ibe = dc->tb_flags & (DRTI_FLAG | DRTB_FLAG | DRTE_FLAG);
> +        uint64_t rt_ibe = dc->tb_flags & (DRTI_FLAG | DRTB_FLAG | DRTE_FLAG);
>          if (unlikely(rt_ibe != 0)) {
>              dc->tb_flags &= ~(DRTI_FLAG | DRTB_FLAG | DRTE_FLAG);
>              if (rt_ibe & DRTI_FLAG) {
> -- 
> 2.55.0
> 
> 

Reviewed-by: Anton Johansson <anjo@rev.ng>


^ permalink raw reply	[flat|nested] 102+ messages in thread

* Re: [PATCH 12/24] target/microblaze: Use 64-bit TB flags
@ 2026-11-27 11:17     ` Anton Johansson via qemu development
  0 siblings, 0 replies; 102+ messages in thread
From: Anton Johansson via @ 2026-11-27 11:17 UTC (permalink / raw)
  To: Philippe Mathieu-Daudé
  Cc: qemu-devel, Richard Henderson, qemu-riscv, qemu-s390x, qemu-arm,
	qemu-ppc, Pierrick Bouvier, Edgar E. Iglesias

On 27/11/26, Philippe Mathieu-Daudé wrote:
> TranslationBlock::flags and TCGTBCPUState::flags are now
> 64-bit, use matching types for the values derived from them.
> 
> Signed-off-by: Philippe Mathieu-Daudé <philmd@oss.qualcomm.com>
> ---
>  target/microblaze/translate.c | 6 +++---
>  1 file changed, 3 insertions(+), 3 deletions(-)
> 
> diff --git a/target/microblaze/translate.c b/target/microblaze/translate.c
> index 8b219afb5dd4..4c869f77f5c0 100644
> --- a/target/microblaze/translate.c
> +++ b/target/microblaze/translate.c
> @@ -68,8 +68,8 @@ typedef struct DisasContext {
>  
>      /* Decoder.  */
>      uint32_t ext_imm;
> -    unsigned int tb_flags;
> -    unsigned int tb_flags_to_set;
> +    uint64_t tb_flags;
> +    uint64_t tb_flags_to_set;
>      int mem_index;
>  
>      /* Condition under which to jump, including NEVER and ALWAYS. */
> @@ -1668,7 +1668,7 @@ static void mb_tr_translate_insn(DisasContextBase *dcb, CPUState *cs)
>          /*
>           * Finish any return-from branch.
>           */
> -        uint32_t rt_ibe = dc->tb_flags & (DRTI_FLAG | DRTB_FLAG | DRTE_FLAG);
> +        uint64_t rt_ibe = dc->tb_flags & (DRTI_FLAG | DRTB_FLAG | DRTE_FLAG);
>          if (unlikely(rt_ibe != 0)) {
>              dc->tb_flags &= ~(DRTI_FLAG | DRTB_FLAG | DRTE_FLAG);
>              if (rt_ibe & DRTI_FLAG) {
> -- 
> 2.55.0
> 
> 

Reviewed-by: Anton Johansson <anjo@rev.ng>


^ permalink raw reply	[flat|nested] 102+ messages in thread

* Re: [PATCH 13/24] target/mips: Use 64-bit TB flags
  2026-11-26 23:35 ` [PATCH 13/24] target/mips: " Philippe Mathieu-Daudé
  2026-11-27 11:19     ` Anton Johansson via
@ 2026-11-27 11:19     ` Anton Johansson via
  0 siblings, 0 replies; 102+ messages in thread
From: Anton Johansson via qemu development @ 2026-11-27 11:19 UTC (permalink / raw)
  To: Philippe Mathieu-Daudé
  Cc: qemu-devel, Richard Henderson, qemu-riscv, qemu-s390x, qemu-arm,
	qemu-ppc, Pierrick Bouvier, Aurelien Jarno, Jiaxun Yang,
	Aleksandar Rikalo

On 27/11/26, Philippe Mathieu-Daudé wrote:
> TranslationBlock::flags and TCGTBCPUState::flags are now
> 64-bit, use matching types for the values derived from them.
> 
> Signed-off-by: Philippe Mathieu-Daudé <philmd@oss.qualcomm.com>
> ---
>  target/mips/cpu.c           | 2 +-
>  target/mips/tcg/translate.c | 2 +-
>  2 files changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/target/mips/cpu.c b/target/mips/cpu.c
> index 324e5989cca1..fb2ece5c9a46 100644
> --- a/target/mips/cpu.c
> +++ b/target/mips/cpu.c
> @@ -682,7 +682,7 @@ static int mips_cpu_mmu_index(CPUState *cs, bool ifunc)
>  static TCGTBCPUState mips_get_tb_cpu_state(CPUState *cs)
>  {
>      CPUMIPSState *env = cpu_env(cs);
> -    uint32_t flags = env->hflags & MIPS_HFLAG_TB_MASK;
> +    uint64_t flags = env->hflags & MIPS_HFLAG_TB_MASK;
>  
>  #ifdef CONFIG_USER_ONLY
>      if (!cs->prctl_unalign_sigbus) {
> diff --git a/target/mips/tcg/translate.c b/target/mips/tcg/translate.c
> index bbcccbbb467f..9c76f1bc00ec 100644
> --- a/target/mips/tcg/translate.c
> +++ b/target/mips/tcg/translate.c
> @@ -15127,7 +15127,7 @@ static void mips_tr_init_disas_context(DisasContextBase *dcbase, CPUState *cs)
>  {
>      DisasContext *ctx = container_of(dcbase, DisasContext, base);
>      CPUMIPSState *env = cpu_env(cs);
> -    uint32_t tb_flags = ctx->base.tb->flags;
> +    uint64_t tb_flags = ctx->base.tb->flags;
>  
>      ctx->page_start = ctx->base.pc_first & TARGET_PAGE_MASK;
>      ctx->saved_pc = -1;
> -- 
> 2.55.0
> 
> 

Reviewed-by: Anton Johansson <anjo@rev.ng>


^ permalink raw reply	[flat|nested] 102+ messages in thread

* Re: [PATCH 13/24] target/mips: Use 64-bit TB flags
@ 2026-11-27 11:19     ` Anton Johansson via
  0 siblings, 0 replies; 102+ messages in thread
From: Anton Johansson via @ 2026-11-27 11:19 UTC (permalink / raw)
  To: Philippe Mathieu-Daudé
  Cc: qemu-devel, Richard Henderson, qemu-riscv, qemu-s390x, qemu-arm,
	qemu-ppc, Pierrick Bouvier, Aurelien Jarno, Jiaxun Yang,
	Aleksandar Rikalo

On 27/11/26, Philippe Mathieu-Daudé wrote:
> TranslationBlock::flags and TCGTBCPUState::flags are now
> 64-bit, use matching types for the values derived from them.
> 
> Signed-off-by: Philippe Mathieu-Daudé <philmd@oss.qualcomm.com>
> ---
>  target/mips/cpu.c           | 2 +-
>  target/mips/tcg/translate.c | 2 +-
>  2 files changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/target/mips/cpu.c b/target/mips/cpu.c
> index 324e5989cca1..fb2ece5c9a46 100644
> --- a/target/mips/cpu.c
> +++ b/target/mips/cpu.c
> @@ -682,7 +682,7 @@ static int mips_cpu_mmu_index(CPUState *cs, bool ifunc)
>  static TCGTBCPUState mips_get_tb_cpu_state(CPUState *cs)
>  {
>      CPUMIPSState *env = cpu_env(cs);
> -    uint32_t flags = env->hflags & MIPS_HFLAG_TB_MASK;
> +    uint64_t flags = env->hflags & MIPS_HFLAG_TB_MASK;
>  
>  #ifdef CONFIG_USER_ONLY
>      if (!cs->prctl_unalign_sigbus) {
> diff --git a/target/mips/tcg/translate.c b/target/mips/tcg/translate.c
> index bbcccbbb467f..9c76f1bc00ec 100644
> --- a/target/mips/tcg/translate.c
> +++ b/target/mips/tcg/translate.c
> @@ -15127,7 +15127,7 @@ static void mips_tr_init_disas_context(DisasContextBase *dcbase, CPUState *cs)
>  {
>      DisasContext *ctx = container_of(dcbase, DisasContext, base);
>      CPUMIPSState *env = cpu_env(cs);
> -    uint32_t tb_flags = ctx->base.tb->flags;
> +    uint64_t tb_flags = ctx->base.tb->flags;
>  
>      ctx->page_start = ctx->base.pc_first & TARGET_PAGE_MASK;
>      ctx->saved_pc = -1;
> -- 
> 2.55.0
> 
> 

Reviewed-by: Anton Johansson <anjo@rev.ng>


^ permalink raw reply	[flat|nested] 102+ messages in thread

* Re: [PATCH 13/24] target/mips: Use 64-bit TB flags
@ 2026-11-27 11:19     ` Anton Johansson via
  0 siblings, 0 replies; 102+ messages in thread
From: Anton Johansson via @ 2026-11-27 11:19 UTC (permalink / raw)
  To: Philippe Mathieu-Daudé
  Cc: qemu-devel, Richard Henderson, qemu-riscv, qemu-s390x, qemu-arm,
	qemu-ppc, Pierrick Bouvier, Aurelien Jarno, Jiaxun Yang,
	Aleksandar Rikalo

On 27/11/26, Philippe Mathieu-Daudé wrote:
> TranslationBlock::flags and TCGTBCPUState::flags are now
> 64-bit, use matching types for the values derived from them.
> 
> Signed-off-by: Philippe Mathieu-Daudé <philmd@oss.qualcomm.com>
> ---
>  target/mips/cpu.c           | 2 +-
>  target/mips/tcg/translate.c | 2 +-
>  2 files changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/target/mips/cpu.c b/target/mips/cpu.c
> index 324e5989cca1..fb2ece5c9a46 100644
> --- a/target/mips/cpu.c
> +++ b/target/mips/cpu.c
> @@ -682,7 +682,7 @@ static int mips_cpu_mmu_index(CPUState *cs, bool ifunc)
>  static TCGTBCPUState mips_get_tb_cpu_state(CPUState *cs)
>  {
>      CPUMIPSState *env = cpu_env(cs);
> -    uint32_t flags = env->hflags & MIPS_HFLAG_TB_MASK;
> +    uint64_t flags = env->hflags & MIPS_HFLAG_TB_MASK;
>  
>  #ifdef CONFIG_USER_ONLY
>      if (!cs->prctl_unalign_sigbus) {
> diff --git a/target/mips/tcg/translate.c b/target/mips/tcg/translate.c
> index bbcccbbb467f..9c76f1bc00ec 100644
> --- a/target/mips/tcg/translate.c
> +++ b/target/mips/tcg/translate.c
> @@ -15127,7 +15127,7 @@ static void mips_tr_init_disas_context(DisasContextBase *dcbase, CPUState *cs)
>  {
>      DisasContext *ctx = container_of(dcbase, DisasContext, base);
>      CPUMIPSState *env = cpu_env(cs);
> -    uint32_t tb_flags = ctx->base.tb->flags;
> +    uint64_t tb_flags = ctx->base.tb->flags;
>  
>      ctx->page_start = ctx->base.pc_first & TARGET_PAGE_MASK;
>      ctx->saved_pc = -1;
> -- 
> 2.55.0
> 
> 

Reviewed-by: Anton Johansson <anjo@rev.ng>


^ permalink raw reply	[flat|nested] 102+ messages in thread

* Re: [PATCH 14/24] target/or1k: Use 64-bit TB flags
  2026-11-26 23:35 ` [PATCH 14/24] target/or1k: " Philippe Mathieu-Daudé
  2026-11-27 11:20     ` Anton Johansson via
@ 2026-11-27 11:20     ` Anton Johansson via
  0 siblings, 0 replies; 102+ messages in thread
From: Anton Johansson via qemu development @ 2026-11-27 11:20 UTC (permalink / raw)
  To: Philippe Mathieu-Daudé
  Cc: qemu-devel, Richard Henderson, qemu-riscv, qemu-s390x, qemu-arm,
	qemu-ppc, Pierrick Bouvier, Stafford Horne

On 27/11/26, Philippe Mathieu-Daudé wrote:
> TranslationBlock::flags and TCGTBCPUState::flags are now
> 64-bit, use matching types for the values derived from them.
> 
> Signed-off-by: Philippe Mathieu-Daudé <philmd@oss.qualcomm.com>
> ---
>  target/or1k/translate.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/target/or1k/translate.c b/target/or1k/translate.c
> index e00ef45b9b76..e656301642d8 100644
> --- a/target/or1k/translate.c
> +++ b/target/or1k/translate.c
> @@ -45,7 +45,7 @@
>  typedef struct DisasContext {
>      DisasContextBase base;
>      uint32_t mem_idx;
> -    uint32_t tb_flags;
> +    uint64_t tb_flags;
>      uint32_t delayed_branch;
>      uint32_t cpucfgr;
>      uint32_t avr;
> -- 
> 2.55.0
> 

Reviewed-by: Anton Johansson <anjo@rev.ng>


^ permalink raw reply	[flat|nested] 102+ messages in thread

* Re: [PATCH 14/24] target/or1k: Use 64-bit TB flags
@ 2026-11-27 11:20     ` Anton Johansson via
  0 siblings, 0 replies; 102+ messages in thread
From: Anton Johansson via @ 2026-11-27 11:20 UTC (permalink / raw)
  To: Philippe Mathieu-Daudé
  Cc: qemu-devel, Richard Henderson, qemu-riscv, qemu-s390x, qemu-arm,
	qemu-ppc, Pierrick Bouvier, Stafford Horne

On 27/11/26, Philippe Mathieu-Daudé wrote:
> TranslationBlock::flags and TCGTBCPUState::flags are now
> 64-bit, use matching types for the values derived from them.
> 
> Signed-off-by: Philippe Mathieu-Daudé <philmd@oss.qualcomm.com>
> ---
>  target/or1k/translate.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/target/or1k/translate.c b/target/or1k/translate.c
> index e00ef45b9b76..e656301642d8 100644
> --- a/target/or1k/translate.c
> +++ b/target/or1k/translate.c
> @@ -45,7 +45,7 @@
>  typedef struct DisasContext {
>      DisasContextBase base;
>      uint32_t mem_idx;
> -    uint32_t tb_flags;
> +    uint64_t tb_flags;
>      uint32_t delayed_branch;
>      uint32_t cpucfgr;
>      uint32_t avr;
> -- 
> 2.55.0
> 

Reviewed-by: Anton Johansson <anjo@rev.ng>


^ permalink raw reply	[flat|nested] 102+ messages in thread

* Re: [PATCH 14/24] target/or1k: Use 64-bit TB flags
@ 2026-11-27 11:20     ` Anton Johansson via
  0 siblings, 0 replies; 102+ messages in thread
From: Anton Johansson via @ 2026-11-27 11:20 UTC (permalink / raw)
  To: Philippe Mathieu-Daudé
  Cc: qemu-devel, Richard Henderson, qemu-riscv, qemu-s390x, qemu-arm,
	qemu-ppc, Pierrick Bouvier, Stafford Horne

On 27/11/26, Philippe Mathieu-Daudé wrote:
> TranslationBlock::flags and TCGTBCPUState::flags are now
> 64-bit, use matching types for the values derived from them.
> 
> Signed-off-by: Philippe Mathieu-Daudé <philmd@oss.qualcomm.com>
> ---
>  target/or1k/translate.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/target/or1k/translate.c b/target/or1k/translate.c
> index e00ef45b9b76..e656301642d8 100644
> --- a/target/or1k/translate.c
> +++ b/target/or1k/translate.c
> @@ -45,7 +45,7 @@
>  typedef struct DisasContext {
>      DisasContextBase base;
>      uint32_t mem_idx;
> -    uint32_t tb_flags;
> +    uint64_t tb_flags;
>      uint32_t delayed_branch;
>      uint32_t cpucfgr;
>      uint32_t avr;
> -- 
> 2.55.0
> 

Reviewed-by: Anton Johansson <anjo@rev.ng>


^ permalink raw reply	[flat|nested] 102+ messages in thread

* Re: [PATCH 16/24] target/riscv: Use 64-bit TB flags
  2026-11-26 23:35 ` [PATCH 16/24] target/riscv: " Philippe Mathieu-Daudé
  2026-11-27 11:23     ` Anton Johansson via qemu development
@ 2026-11-27 11:23     ` Anton Johansson via qemu development
  2026-12-01  1:16   ` Alistair Francis
  2 siblings, 0 replies; 102+ messages in thread
From: Anton Johansson via @ 2026-11-27 11:23 UTC (permalink / raw)
  To: Philippe Mathieu-Daudé
  Cc: qemu-devel, Richard Henderson, qemu-riscv, qemu-s390x, qemu-arm,
	qemu-ppc, Pierrick Bouvier, Palmer Dabbelt, Alistair Francis,
	Weiwei Li, Daniel Henrique Barboza, Liu Zhiwei, Chao Liu

On 27/11/26, Philippe Mathieu-Daudé wrote:
> TranslationBlock::flags and TCGTBCPUState::flags are now
> 64-bit, use matching types for the values derived from them.
> 
> Signed-off-by: Philippe Mathieu-Daudé <philmd@oss.qualcomm.com>
> ---
>  target/riscv/tcg/tcg-cpu.c   | 46 ++++++++++++++++++------------------
>  target/riscv/tcg/translate.c | 42 ++++++++++++++++----------------
>  2 files changed, 44 insertions(+), 44 deletions(-)

Reviewed-by: Anton Johansson <anjo@rev.ng>


^ permalink raw reply	[flat|nested] 102+ messages in thread

* Re: [PATCH 16/24] target/riscv: Use 64-bit TB flags
@ 2026-11-27 11:23     ` Anton Johansson via qemu development
  0 siblings, 0 replies; 102+ messages in thread
From: Anton Johansson via qemu development @ 2026-11-27 11:23 UTC (permalink / raw)
  To: Philippe Mathieu-Daudé
  Cc: qemu-devel, Richard Henderson, qemu-riscv, qemu-s390x, qemu-arm,
	qemu-ppc, Pierrick Bouvier, Palmer Dabbelt, Alistair Francis,
	Weiwei Li, Daniel Henrique Barboza, Liu Zhiwei, Chao Liu

On 27/11/26, Philippe Mathieu-Daudé wrote:
> TranslationBlock::flags and TCGTBCPUState::flags are now
> 64-bit, use matching types for the values derived from them.
> 
> Signed-off-by: Philippe Mathieu-Daudé <philmd@oss.qualcomm.com>
> ---
>  target/riscv/tcg/tcg-cpu.c   | 46 ++++++++++++++++++------------------
>  target/riscv/tcg/translate.c | 42 ++++++++++++++++----------------
>  2 files changed, 44 insertions(+), 44 deletions(-)

Reviewed-by: Anton Johansson <anjo@rev.ng>


^ permalink raw reply	[flat|nested] 102+ messages in thread

* Re: [PATCH 16/24] target/riscv: Use 64-bit TB flags
@ 2026-11-27 11:23     ` Anton Johansson via qemu development
  0 siblings, 0 replies; 102+ messages in thread
From: Anton Johansson via @ 2026-11-27 11:23 UTC (permalink / raw)
  To: Philippe Mathieu-Daudé
  Cc: qemu-devel, Richard Henderson, qemu-riscv, qemu-s390x, qemu-arm,
	qemu-ppc, Pierrick Bouvier, Palmer Dabbelt, Alistair Francis,
	Weiwei Li, Daniel Henrique Barboza, Liu Zhiwei, Chao Liu

On 27/11/26, Philippe Mathieu-Daudé wrote:
> TranslationBlock::flags and TCGTBCPUState::flags are now
> 64-bit, use matching types for the values derived from them.
> 
> Signed-off-by: Philippe Mathieu-Daudé <philmd@oss.qualcomm.com>
> ---
>  target/riscv/tcg/tcg-cpu.c   | 46 ++++++++++++++++++------------------
>  target/riscv/tcg/translate.c | 42 ++++++++++++++++----------------
>  2 files changed, 44 insertions(+), 44 deletions(-)

Reviewed-by: Anton Johansson <anjo@rev.ng>


^ permalink raw reply	[flat|nested] 102+ messages in thread

* Re: [PATCH 17/24] target/riscv: Partially revert use of tb->cs_base
  2026-11-26 23:35 ` [PATCH 17/24] target/riscv: Partially revert use of tb->cs_base Philippe Mathieu-Daudé
  2026-11-27 11:26     ` Anton Johansson via
@ 2026-11-27 11:26     ` Anton Johansson via
  1 sibling, 0 replies; 102+ messages in thread
From: Anton Johansson via qemu development @ 2026-11-27 11:26 UTC (permalink / raw)
  To: Philippe Mathieu-Daudé
  Cc: qemu-devel, Richard Henderson, qemu-riscv, qemu-s390x, qemu-arm,
	qemu-ppc, Pierrick Bouvier, Palmer Dabbelt, Alistair Francis,
	Weiwei Li, Daniel Henrique Barboza, Liu Zhiwei, Chao Liu

On 27/11/26, Philippe Mathieu-Daudé wrote:
> Partially revert commit 1c88ab9e77bd ("target/riscv: Use the
> tb->cs_base as the extend tb flags"): now that TranslationBlock::flags
> is 64-bit, keep only misa_ext in tb->cs_base (as in 55b490b58fbf) and
> move the other extended flags (ALTFMT, BIG_ENDIAN, SDEXT_STEP) into
> TB_FLAGS at bits 32+.
> 
> Signed-off-by: Philippe Mathieu-Daudé <philmd@oss.qualcomm.com>
> ---
>  include/exec/translation-block.h |  2 +-
>  target/riscv/cpu.h               |  8 +++-----
>  target/riscv/tcg/tcg-cpu.c       | 12 +++++-------
>  target/riscv/tcg/translate.c     |  7 +++----
>  4 files changed, 12 insertions(+), 17 deletions(-)

Reviewed-by: Anton Johansson <anjo@rev.ng>


^ permalink raw reply	[flat|nested] 102+ messages in thread

* Re: [PATCH 17/24] target/riscv: Partially revert use of tb->cs_base
@ 2026-11-27 11:26     ` Anton Johansson via
  0 siblings, 0 replies; 102+ messages in thread
From: Anton Johansson via @ 2026-11-27 11:26 UTC (permalink / raw)
  To: Philippe Mathieu-Daudé
  Cc: qemu-devel, Richard Henderson, qemu-riscv, qemu-s390x, qemu-arm,
	qemu-ppc, Pierrick Bouvier, Palmer Dabbelt, Alistair Francis,
	Weiwei Li, Daniel Henrique Barboza, Liu Zhiwei, Chao Liu

On 27/11/26, Philippe Mathieu-Daudé wrote:
> Partially revert commit 1c88ab9e77bd ("target/riscv: Use the
> tb->cs_base as the extend tb flags"): now that TranslationBlock::flags
> is 64-bit, keep only misa_ext in tb->cs_base (as in 55b490b58fbf) and
> move the other extended flags (ALTFMT, BIG_ENDIAN, SDEXT_STEP) into
> TB_FLAGS at bits 32+.
> 
> Signed-off-by: Philippe Mathieu-Daudé <philmd@oss.qualcomm.com>
> ---
>  include/exec/translation-block.h |  2 +-
>  target/riscv/cpu.h               |  8 +++-----
>  target/riscv/tcg/tcg-cpu.c       | 12 +++++-------
>  target/riscv/tcg/translate.c     |  7 +++----
>  4 files changed, 12 insertions(+), 17 deletions(-)

Reviewed-by: Anton Johansson <anjo@rev.ng>


^ permalink raw reply	[flat|nested] 102+ messages in thread

* Re: [PATCH 17/24] target/riscv: Partially revert use of tb->cs_base
@ 2026-11-27 11:26     ` Anton Johansson via
  0 siblings, 0 replies; 102+ messages in thread
From: Anton Johansson via @ 2026-11-27 11:26 UTC (permalink / raw)
  To: Philippe Mathieu-Daudé
  Cc: qemu-devel, Richard Henderson, qemu-riscv, qemu-s390x, qemu-arm,
	qemu-ppc, Pierrick Bouvier, Palmer Dabbelt, Alistair Francis,
	Weiwei Li, Daniel Henrique Barboza, Liu Zhiwei, Chao Liu

On 27/11/26, Philippe Mathieu-Daudé wrote:
> Partially revert commit 1c88ab9e77bd ("target/riscv: Use the
> tb->cs_base as the extend tb flags"): now that TranslationBlock::flags
> is 64-bit, keep only misa_ext in tb->cs_base (as in 55b490b58fbf) and
> move the other extended flags (ALTFMT, BIG_ENDIAN, SDEXT_STEP) into
> TB_FLAGS at bits 32+.
> 
> Signed-off-by: Philippe Mathieu-Daudé <philmd@oss.qualcomm.com>
> ---
>  include/exec/translation-block.h |  2 +-
>  target/riscv/cpu.h               |  8 +++-----
>  target/riscv/tcg/tcg-cpu.c       | 12 +++++-------
>  target/riscv/tcg/translate.c     |  7 +++----
>  4 files changed, 12 insertions(+), 17 deletions(-)

Reviewed-by: Anton Johansson <anjo@rev.ng>


^ permalink raw reply	[flat|nested] 102+ messages in thread

* Re: [PATCH 18/24] target/rx: Use 64-bit TB flags
  2026-11-26 23:35 ` [PATCH 18/24] target/rx: Use 64-bit TB flags Philippe Mathieu-Daudé
  2026-11-27 11:27     ` Anton Johansson via
@ 2026-11-27 11:27     ` Anton Johansson via
  1 sibling, 0 replies; 102+ messages in thread
From: Anton Johansson via qemu development @ 2026-11-27 11:27 UTC (permalink / raw)
  To: Philippe Mathieu-Daudé
  Cc: qemu-devel, Richard Henderson, qemu-riscv, qemu-s390x, qemu-arm,
	qemu-ppc, Pierrick Bouvier, Yoshinori Sato

On 27/11/26, Philippe Mathieu-Daudé wrote:
> TranslationBlock::flags and TCGTBCPUState::flags are now
> 64-bit, use matching types for the values derived from them.
> 
> Signed-off-by: Philippe Mathieu-Daudé <philmd@oss.qualcomm.com>
> ---
>  target/rx/cpu.c       |  6 +++---
>  target/rx/translate.c | 16 ++++++++--------
>  2 files changed, 11 insertions(+), 11 deletions(-)
> 
> diff --git a/target/rx/cpu.c b/target/rx/cpu.c
> index c35a98f7cefa..dba253bda9b1 100644
> --- a/target/rx/cpu.c
> +++ b/target/rx/cpu.c
> @@ -47,10 +47,10 @@ static vaddr rx_cpu_get_pc(CPUState *cs)
>  static TCGTBCPUState rx_get_tb_cpu_state(CPUState *cs)
>  {
>      CPURXState *env = cpu_env(cs);
> -    uint32_t flags = 0;
> +    uint64_t flags = 0;
>  
> -    flags = FIELD_DP32(flags, PSW, PM, env->psw_pm);
> -    flags = FIELD_DP32(flags, PSW, U, env->psw_u);
> +    flags = FIELD_DP64(flags, PSW, PM, env->psw_pm);
> +    flags = FIELD_DP64(flags, PSW, U, env->psw_u);
>  
>      return (TCGTBCPUState){ .pc = env->pc, .flags = flags };
>  }
> diff --git a/target/rx/translate.c b/target/rx/translate.c
> index 1bacc7adf929..69547c83cc05 100644
> --- a/target/rx/translate.c
> +++ b/target/rx/translate.c
> @@ -36,7 +36,7 @@ typedef struct DisasContext {
>      DisasContextBase base;
>      CPURXState *env;
>      uint32_t pc;
> -    uint32_t tb_flags;
> +    uint64_t tb_flags;
>  } DisasContext;
>  
>  typedef struct DisasCompare {
> @@ -243,7 +243,7 @@ static TCGv_i32 rx_load_source(DisasContext *ctx, TCGv_i32 mem,
>  /* Processor mode check */
>  static int is_privileged(DisasContext *ctx, int is_exception)
>  {
> -    if (FIELD_EX32(ctx->tb_flags, PSW, PM)) {
> +    if (FIELD_EX64(ctx->tb_flags, PSW, PM)) {
>          if (is_exception) {
>              gen_helper_raise_privilege_violation(tcg_env);
>          }
> @@ -332,7 +332,7 @@ static void move_from_cr(DisasContext *ctx, TCGv_i32 ret, int cr, uint32_t pc)
>          tcg_gen_movi_i32(ret, pc);
>          break;
>      case 2:     /* USP */
> -        if (FIELD_EX32(ctx->tb_flags, PSW, U)) {
> +        if (FIELD_EX64(ctx->tb_flags, PSW, U)) {
>              tcg_gen_mov_i32(ret, cpu_sp);
>          } else {
>              tcg_gen_mov_i32(ret, cpu_usp);
> @@ -348,7 +348,7 @@ static void move_from_cr(DisasContext *ctx, TCGv_i32 ret, int cr, uint32_t pc)
>          tcg_gen_mov_i32(ret, cpu_bpc);
>          break;
>      case 10:    /* ISP */
> -        if (FIELD_EX32(ctx->tb_flags, PSW, U)) {
> +        if (FIELD_EX64(ctx->tb_flags, PSW, U)) {
>              tcg_gen_mov_i32(ret, cpu_isp);
>          } else {
>              tcg_gen_mov_i32(ret, cpu_sp);
> @@ -386,7 +386,7 @@ static void move_to_cr(DisasContext *ctx, TCGv_i32 val, int cr)
>          break;
>      /* case 1: to PC not supported */
>      case 2:     /* USP */
> -        if (FIELD_EX32(ctx->tb_flags, PSW, U)) {
> +        if (FIELD_EX64(ctx->tb_flags, PSW, U)) {
>              tcg_gen_mov_i32(cpu_sp, val);
>          } else {
>              tcg_gen_mov_i32(cpu_usp, val);
> @@ -402,7 +402,7 @@ static void move_to_cr(DisasContext *ctx, TCGv_i32 val, int cr)
>          tcg_gen_mov_i32(cpu_bpc, val);
>          break;
>      case 10:    /* ISP */
> -        if (FIELD_EX32(ctx->tb_flags, PSW, U)) {
> +        if (FIELD_EX64(ctx->tb_flags, PSW, U)) {
>              tcg_gen_mov_i32(cpu_isp, val);
>          } else {
>              tcg_gen_mov_i32(cpu_sp, val);
> @@ -2080,8 +2080,8 @@ static void clrsetpsw(DisasContext *ctx, int cb, int val)
>              ctx->base.is_jmp = DISAS_UPDATE;
>              break;
>          case PSW_U:
> -            if (FIELD_EX32(ctx->tb_flags, PSW, U) != val) {
> -                ctx->tb_flags = FIELD_DP32(ctx->tb_flags, PSW, U, val);
> +            if (FIELD_EX64(ctx->tb_flags, PSW, U) != val) {
> +                ctx->tb_flags = FIELD_DP64(ctx->tb_flags, PSW, U, val);
>                  tcg_gen_movi_i32(cpu_psw_u, val);
>                  tcg_gen_mov_i32(val ? cpu_isp : cpu_usp, cpu_sp);
>                  tcg_gen_mov_i32(cpu_sp, val ? cpu_usp : cpu_isp);
> -- 
> 2.55.0
> 

Reviewed-by: Anton Johansson <anjo@rev.ng>


^ permalink raw reply	[flat|nested] 102+ messages in thread

* Re: [PATCH 18/24] target/rx: Use 64-bit TB flags
@ 2026-11-27 11:27     ` Anton Johansson via
  0 siblings, 0 replies; 102+ messages in thread
From: Anton Johansson via @ 2026-11-27 11:27 UTC (permalink / raw)
  To: Philippe Mathieu-Daudé
  Cc: qemu-devel, Richard Henderson, qemu-riscv, qemu-s390x, qemu-arm,
	qemu-ppc, Pierrick Bouvier, Yoshinori Sato

On 27/11/26, Philippe Mathieu-Daudé wrote:
> TranslationBlock::flags and TCGTBCPUState::flags are now
> 64-bit, use matching types for the values derived from them.
> 
> Signed-off-by: Philippe Mathieu-Daudé <philmd@oss.qualcomm.com>
> ---
>  target/rx/cpu.c       |  6 +++---
>  target/rx/translate.c | 16 ++++++++--------
>  2 files changed, 11 insertions(+), 11 deletions(-)
> 
> diff --git a/target/rx/cpu.c b/target/rx/cpu.c
> index c35a98f7cefa..dba253bda9b1 100644
> --- a/target/rx/cpu.c
> +++ b/target/rx/cpu.c
> @@ -47,10 +47,10 @@ static vaddr rx_cpu_get_pc(CPUState *cs)
>  static TCGTBCPUState rx_get_tb_cpu_state(CPUState *cs)
>  {
>      CPURXState *env = cpu_env(cs);
> -    uint32_t flags = 0;
> +    uint64_t flags = 0;
>  
> -    flags = FIELD_DP32(flags, PSW, PM, env->psw_pm);
> -    flags = FIELD_DP32(flags, PSW, U, env->psw_u);
> +    flags = FIELD_DP64(flags, PSW, PM, env->psw_pm);
> +    flags = FIELD_DP64(flags, PSW, U, env->psw_u);
>  
>      return (TCGTBCPUState){ .pc = env->pc, .flags = flags };
>  }
> diff --git a/target/rx/translate.c b/target/rx/translate.c
> index 1bacc7adf929..69547c83cc05 100644
> --- a/target/rx/translate.c
> +++ b/target/rx/translate.c
> @@ -36,7 +36,7 @@ typedef struct DisasContext {
>      DisasContextBase base;
>      CPURXState *env;
>      uint32_t pc;
> -    uint32_t tb_flags;
> +    uint64_t tb_flags;
>  } DisasContext;
>  
>  typedef struct DisasCompare {
> @@ -243,7 +243,7 @@ static TCGv_i32 rx_load_source(DisasContext *ctx, TCGv_i32 mem,
>  /* Processor mode check */
>  static int is_privileged(DisasContext *ctx, int is_exception)
>  {
> -    if (FIELD_EX32(ctx->tb_flags, PSW, PM)) {
> +    if (FIELD_EX64(ctx->tb_flags, PSW, PM)) {
>          if (is_exception) {
>              gen_helper_raise_privilege_violation(tcg_env);
>          }
> @@ -332,7 +332,7 @@ static void move_from_cr(DisasContext *ctx, TCGv_i32 ret, int cr, uint32_t pc)
>          tcg_gen_movi_i32(ret, pc);
>          break;
>      case 2:     /* USP */
> -        if (FIELD_EX32(ctx->tb_flags, PSW, U)) {
> +        if (FIELD_EX64(ctx->tb_flags, PSW, U)) {
>              tcg_gen_mov_i32(ret, cpu_sp);
>          } else {
>              tcg_gen_mov_i32(ret, cpu_usp);
> @@ -348,7 +348,7 @@ static void move_from_cr(DisasContext *ctx, TCGv_i32 ret, int cr, uint32_t pc)
>          tcg_gen_mov_i32(ret, cpu_bpc);
>          break;
>      case 10:    /* ISP */
> -        if (FIELD_EX32(ctx->tb_flags, PSW, U)) {
> +        if (FIELD_EX64(ctx->tb_flags, PSW, U)) {
>              tcg_gen_mov_i32(ret, cpu_isp);
>          } else {
>              tcg_gen_mov_i32(ret, cpu_sp);
> @@ -386,7 +386,7 @@ static void move_to_cr(DisasContext *ctx, TCGv_i32 val, int cr)
>          break;
>      /* case 1: to PC not supported */
>      case 2:     /* USP */
> -        if (FIELD_EX32(ctx->tb_flags, PSW, U)) {
> +        if (FIELD_EX64(ctx->tb_flags, PSW, U)) {
>              tcg_gen_mov_i32(cpu_sp, val);
>          } else {
>              tcg_gen_mov_i32(cpu_usp, val);
> @@ -402,7 +402,7 @@ static void move_to_cr(DisasContext *ctx, TCGv_i32 val, int cr)
>          tcg_gen_mov_i32(cpu_bpc, val);
>          break;
>      case 10:    /* ISP */
> -        if (FIELD_EX32(ctx->tb_flags, PSW, U)) {
> +        if (FIELD_EX64(ctx->tb_flags, PSW, U)) {
>              tcg_gen_mov_i32(cpu_isp, val);
>          } else {
>              tcg_gen_mov_i32(cpu_sp, val);
> @@ -2080,8 +2080,8 @@ static void clrsetpsw(DisasContext *ctx, int cb, int val)
>              ctx->base.is_jmp = DISAS_UPDATE;
>              break;
>          case PSW_U:
> -            if (FIELD_EX32(ctx->tb_flags, PSW, U) != val) {
> -                ctx->tb_flags = FIELD_DP32(ctx->tb_flags, PSW, U, val);
> +            if (FIELD_EX64(ctx->tb_flags, PSW, U) != val) {
> +                ctx->tb_flags = FIELD_DP64(ctx->tb_flags, PSW, U, val);
>                  tcg_gen_movi_i32(cpu_psw_u, val);
>                  tcg_gen_mov_i32(val ? cpu_isp : cpu_usp, cpu_sp);
>                  tcg_gen_mov_i32(cpu_sp, val ? cpu_usp : cpu_isp);
> -- 
> 2.55.0
> 

Reviewed-by: Anton Johansson <anjo@rev.ng>


^ permalink raw reply	[flat|nested] 102+ messages in thread

* Re: [PATCH 18/24] target/rx: Use 64-bit TB flags
@ 2026-11-27 11:27     ` Anton Johansson via
  0 siblings, 0 replies; 102+ messages in thread
From: Anton Johansson via @ 2026-11-27 11:27 UTC (permalink / raw)
  To: Philippe Mathieu-Daudé
  Cc: qemu-devel, Richard Henderson, qemu-riscv, qemu-s390x, qemu-arm,
	qemu-ppc, Pierrick Bouvier, Yoshinori Sato

On 27/11/26, Philippe Mathieu-Daudé wrote:
> TranslationBlock::flags and TCGTBCPUState::flags are now
> 64-bit, use matching types for the values derived from them.
> 
> Signed-off-by: Philippe Mathieu-Daudé <philmd@oss.qualcomm.com>
> ---
>  target/rx/cpu.c       |  6 +++---
>  target/rx/translate.c | 16 ++++++++--------
>  2 files changed, 11 insertions(+), 11 deletions(-)
> 
> diff --git a/target/rx/cpu.c b/target/rx/cpu.c
> index c35a98f7cefa..dba253bda9b1 100644
> --- a/target/rx/cpu.c
> +++ b/target/rx/cpu.c
> @@ -47,10 +47,10 @@ static vaddr rx_cpu_get_pc(CPUState *cs)
>  static TCGTBCPUState rx_get_tb_cpu_state(CPUState *cs)
>  {
>      CPURXState *env = cpu_env(cs);
> -    uint32_t flags = 0;
> +    uint64_t flags = 0;
>  
> -    flags = FIELD_DP32(flags, PSW, PM, env->psw_pm);
> -    flags = FIELD_DP32(flags, PSW, U, env->psw_u);
> +    flags = FIELD_DP64(flags, PSW, PM, env->psw_pm);
> +    flags = FIELD_DP64(flags, PSW, U, env->psw_u);
>  
>      return (TCGTBCPUState){ .pc = env->pc, .flags = flags };
>  }
> diff --git a/target/rx/translate.c b/target/rx/translate.c
> index 1bacc7adf929..69547c83cc05 100644
> --- a/target/rx/translate.c
> +++ b/target/rx/translate.c
> @@ -36,7 +36,7 @@ typedef struct DisasContext {
>      DisasContextBase base;
>      CPURXState *env;
>      uint32_t pc;
> -    uint32_t tb_flags;
> +    uint64_t tb_flags;
>  } DisasContext;
>  
>  typedef struct DisasCompare {
> @@ -243,7 +243,7 @@ static TCGv_i32 rx_load_source(DisasContext *ctx, TCGv_i32 mem,
>  /* Processor mode check */
>  static int is_privileged(DisasContext *ctx, int is_exception)
>  {
> -    if (FIELD_EX32(ctx->tb_flags, PSW, PM)) {
> +    if (FIELD_EX64(ctx->tb_flags, PSW, PM)) {
>          if (is_exception) {
>              gen_helper_raise_privilege_violation(tcg_env);
>          }
> @@ -332,7 +332,7 @@ static void move_from_cr(DisasContext *ctx, TCGv_i32 ret, int cr, uint32_t pc)
>          tcg_gen_movi_i32(ret, pc);
>          break;
>      case 2:     /* USP */
> -        if (FIELD_EX32(ctx->tb_flags, PSW, U)) {
> +        if (FIELD_EX64(ctx->tb_flags, PSW, U)) {
>              tcg_gen_mov_i32(ret, cpu_sp);
>          } else {
>              tcg_gen_mov_i32(ret, cpu_usp);
> @@ -348,7 +348,7 @@ static void move_from_cr(DisasContext *ctx, TCGv_i32 ret, int cr, uint32_t pc)
>          tcg_gen_mov_i32(ret, cpu_bpc);
>          break;
>      case 10:    /* ISP */
> -        if (FIELD_EX32(ctx->tb_flags, PSW, U)) {
> +        if (FIELD_EX64(ctx->tb_flags, PSW, U)) {
>              tcg_gen_mov_i32(ret, cpu_isp);
>          } else {
>              tcg_gen_mov_i32(ret, cpu_sp);
> @@ -386,7 +386,7 @@ static void move_to_cr(DisasContext *ctx, TCGv_i32 val, int cr)
>          break;
>      /* case 1: to PC not supported */
>      case 2:     /* USP */
> -        if (FIELD_EX32(ctx->tb_flags, PSW, U)) {
> +        if (FIELD_EX64(ctx->tb_flags, PSW, U)) {
>              tcg_gen_mov_i32(cpu_sp, val);
>          } else {
>              tcg_gen_mov_i32(cpu_usp, val);
> @@ -402,7 +402,7 @@ static void move_to_cr(DisasContext *ctx, TCGv_i32 val, int cr)
>          tcg_gen_mov_i32(cpu_bpc, val);
>          break;
>      case 10:    /* ISP */
> -        if (FIELD_EX32(ctx->tb_flags, PSW, U)) {
> +        if (FIELD_EX64(ctx->tb_flags, PSW, U)) {
>              tcg_gen_mov_i32(cpu_isp, val);
>          } else {
>              tcg_gen_mov_i32(cpu_sp, val);
> @@ -2080,8 +2080,8 @@ static void clrsetpsw(DisasContext *ctx, int cb, int val)
>              ctx->base.is_jmp = DISAS_UPDATE;
>              break;
>          case PSW_U:
> -            if (FIELD_EX32(ctx->tb_flags, PSW, U) != val) {
> -                ctx->tb_flags = FIELD_DP32(ctx->tb_flags, PSW, U, val);
> +            if (FIELD_EX64(ctx->tb_flags, PSW, U) != val) {
> +                ctx->tb_flags = FIELD_DP64(ctx->tb_flags, PSW, U, val);
>                  tcg_gen_movi_i32(cpu_psw_u, val);
>                  tcg_gen_mov_i32(val ? cpu_isp : cpu_usp, cpu_sp);
>                  tcg_gen_mov_i32(cpu_sp, val ? cpu_usp : cpu_isp);
> -- 
> 2.55.0
> 

Reviewed-by: Anton Johansson <anjo@rev.ng>


^ permalink raw reply	[flat|nested] 102+ messages in thread

* Re: [PATCH 19/24] target/s390x: Use 64-bit TB flags
  2026-11-26 23:35 ` [PATCH 19/24] target/s390x: " Philippe Mathieu-Daudé
  2026-11-27 11:27     ` Anton Johansson via
@ 2026-11-27 11:27     ` Anton Johansson via
  0 siblings, 0 replies; 102+ messages in thread
From: Anton Johansson via @ 2026-11-27 11:27 UTC (permalink / raw)
  To: Philippe Mathieu-Daudé
  Cc: qemu-devel, Richard Henderson, qemu-riscv, qemu-s390x, qemu-arm,
	qemu-ppc, Pierrick Bouvier, Ilya Leoshkevich, David Hildenbrand,
	Cornelia Huck, Eric Farman, Matthew Rosato

On 27/11/26, Philippe Mathieu-Daudé wrote:
> TranslationBlock::flags and TCGTBCPUState::flags are now
> 64-bit, use matching types for the values derived from them.
> 
> Signed-off-by: Philippe Mathieu-Daudé <philmd@oss.qualcomm.com>
> ---
>  target/s390x/cpu.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/target/s390x/cpu.c b/target/s390x/cpu.c
> index d1250945d489..c6564974c50e 100644
> --- a/target/s390x/cpu.c
> +++ b/target/s390x/cpu.c
> @@ -319,7 +319,7 @@ static int s390x_cpu_mmu_index(CPUState *cs, bool ifetch)
>  static TCGTBCPUState s390x_get_tb_cpu_state(CPUState *cs)
>  {
>      CPUS390XState *env = cpu_env(cs);
> -    uint32_t flags;
> +    uint64_t flags;
>  
>      if (env->psw.addr & 1) {
>          /*
> -- 
> 2.55.0
> 
> 

Reviewed-by: Anton Johansson <anjo@rev.ng>


^ permalink raw reply	[flat|nested] 102+ messages in thread

* Re: [PATCH 19/24] target/s390x: Use 64-bit TB flags
@ 2026-11-27 11:27     ` Anton Johansson via
  0 siblings, 0 replies; 102+ messages in thread
From: Anton Johansson via @ 2026-11-27 11:27 UTC (permalink / raw)
  To: Philippe Mathieu-Daudé
  Cc: qemu-devel, Richard Henderson, qemu-riscv, qemu-s390x, qemu-arm,
	qemu-ppc, Pierrick Bouvier, Ilya Leoshkevich, David Hildenbrand,
	Cornelia Huck, Eric Farman, Matthew Rosato

On 27/11/26, Philippe Mathieu-Daudé wrote:
> TranslationBlock::flags and TCGTBCPUState::flags are now
> 64-bit, use matching types for the values derived from them.
> 
> Signed-off-by: Philippe Mathieu-Daudé <philmd@oss.qualcomm.com>
> ---
>  target/s390x/cpu.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/target/s390x/cpu.c b/target/s390x/cpu.c
> index d1250945d489..c6564974c50e 100644
> --- a/target/s390x/cpu.c
> +++ b/target/s390x/cpu.c
> @@ -319,7 +319,7 @@ static int s390x_cpu_mmu_index(CPUState *cs, bool ifetch)
>  static TCGTBCPUState s390x_get_tb_cpu_state(CPUState *cs)
>  {
>      CPUS390XState *env = cpu_env(cs);
> -    uint32_t flags;
> +    uint64_t flags;
>  
>      if (env->psw.addr & 1) {
>          /*
> -- 
> 2.55.0
> 
> 

Reviewed-by: Anton Johansson <anjo@rev.ng>


^ permalink raw reply	[flat|nested] 102+ messages in thread

* Re: [PATCH 19/24] target/s390x: Use 64-bit TB flags
@ 2026-11-27 11:27     ` Anton Johansson via
  0 siblings, 0 replies; 102+ messages in thread
From: Anton Johansson via qemu development @ 2026-11-27 11:27 UTC (permalink / raw)
  To: Philippe Mathieu-Daudé
  Cc: qemu-devel, Richard Henderson, qemu-riscv, qemu-s390x, qemu-arm,
	qemu-ppc, Pierrick Bouvier, Ilya Leoshkevich, David Hildenbrand,
	Cornelia Huck, Eric Farman, Matthew Rosato

On 27/11/26, Philippe Mathieu-Daudé wrote:
> TranslationBlock::flags and TCGTBCPUState::flags are now
> 64-bit, use matching types for the values derived from them.
> 
> Signed-off-by: Philippe Mathieu-Daudé <philmd@oss.qualcomm.com>
> ---
>  target/s390x/cpu.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/target/s390x/cpu.c b/target/s390x/cpu.c
> index d1250945d489..c6564974c50e 100644
> --- a/target/s390x/cpu.c
> +++ b/target/s390x/cpu.c
> @@ -319,7 +319,7 @@ static int s390x_cpu_mmu_index(CPUState *cs, bool ifetch)
>  static TCGTBCPUState s390x_get_tb_cpu_state(CPUState *cs)
>  {
>      CPUS390XState *env = cpu_env(cs);
> -    uint32_t flags;
> +    uint64_t flags;
>  
>      if (env->psw.addr & 1) {
>          /*
> -- 
> 2.55.0
> 
> 

Reviewed-by: Anton Johansson <anjo@rev.ng>


^ permalink raw reply	[flat|nested] 102+ messages in thread

* Re: [PATCH 20/24] target/sh4: Use 64-bit TB flags
  2026-11-26 23:35 ` [PATCH 20/24] target/sh4: " Philippe Mathieu-Daudé
  2026-11-27 11:29     ` Anton Johansson via
@ 2026-11-27 11:29     ` Anton Johansson via
  1 sibling, 0 replies; 102+ messages in thread
From: Anton Johansson via @ 2026-11-27 11:29 UTC (permalink / raw)
  To: Philippe Mathieu-Daudé
  Cc: qemu-devel, Richard Henderson, qemu-riscv, qemu-s390x, qemu-arm,
	qemu-ppc, Pierrick Bouvier, Yoshinori Sato

On 27/11/26, Philippe Mathieu-Daudé wrote:
> TranslationBlock::flags and TCGTBCPUState::flags are now
> 64-bit, use matching types for the values derived from them.
> 
> Signed-off-by: Philippe Mathieu-Daudé <philmd@oss.qualcomm.com>
> ---
>  target/sh4/cpu.c       | 2 +-
>  target/sh4/translate.c | 4 ++--
>  2 files changed, 3 insertions(+), 3 deletions(-)
> 
> diff --git a/target/sh4/cpu.c b/target/sh4/cpu.c
> index 17731935779e..90e3e4d52b82 100644
> --- a/target/sh4/cpu.c
> +++ b/target/sh4/cpu.c
> @@ -47,7 +47,7 @@ static vaddr superh_cpu_get_pc(CPUState *cs)
>  static TCGTBCPUState superh_get_tb_cpu_state(CPUState *cs)
>  {
>      CPUSH4State *env = cpu_env(cs);
> -    uint32_t flags;
> +    uint64_t flags;
>  
>      flags = env->flags
>              | (env->fpscr & TB_FLAG_FPSCR_MASK)
> diff --git a/target/sh4/translate.c b/target/sh4/translate.c
> index 5729a757f191..0f43a5dced14 100644
> --- a/target/sh4/translate.c
> +++ b/target/sh4/translate.c
> @@ -36,7 +36,7 @@
>  typedef struct DisasContext {
>      DisasContextBase base;
>  
> -    uint32_t tbflags;  /* should stay unmodified during the TB translation */
> +    uint64_t tbflags;  /* should stay unmodified during the TB translation */
>      uint32_t envflags; /* should stay in sync with env->flags using TCG ops */
>      int memidx;
>      int gbank;
> @@ -2177,7 +2177,7 @@ static void decode_gusa(DisasContext *ctx, CPUSH4State *env)
>  static void sh4_tr_init_disas_context(DisasContextBase *dcbase, CPUState *cs)
>  {
>      DisasContext *ctx = container_of(dcbase, DisasContext, base);
> -    uint32_t tbflags;
> +    uint64_t tbflags;
>      int bound;
>  
>      ctx->tbflags = tbflags = ctx->base.tb->flags;
> -- 
> 2.55.0
> 

Reviewed-by: Anton Johansson <anjo@rev.ng>


^ permalink raw reply	[flat|nested] 102+ messages in thread

* Re: [PATCH 20/24] target/sh4: Use 64-bit TB flags
@ 2026-11-27 11:29     ` Anton Johansson via
  0 siblings, 0 replies; 102+ messages in thread
From: Anton Johansson via @ 2026-11-27 11:29 UTC (permalink / raw)
  To: Philippe Mathieu-Daudé
  Cc: qemu-devel, Richard Henderson, qemu-riscv, qemu-s390x, qemu-arm,
	qemu-ppc, Pierrick Bouvier, Yoshinori Sato

On 27/11/26, Philippe Mathieu-Daudé wrote:
> TranslationBlock::flags and TCGTBCPUState::flags are now
> 64-bit, use matching types for the values derived from them.
> 
> Signed-off-by: Philippe Mathieu-Daudé <philmd@oss.qualcomm.com>
> ---
>  target/sh4/cpu.c       | 2 +-
>  target/sh4/translate.c | 4 ++--
>  2 files changed, 3 insertions(+), 3 deletions(-)
> 
> diff --git a/target/sh4/cpu.c b/target/sh4/cpu.c
> index 17731935779e..90e3e4d52b82 100644
> --- a/target/sh4/cpu.c
> +++ b/target/sh4/cpu.c
> @@ -47,7 +47,7 @@ static vaddr superh_cpu_get_pc(CPUState *cs)
>  static TCGTBCPUState superh_get_tb_cpu_state(CPUState *cs)
>  {
>      CPUSH4State *env = cpu_env(cs);
> -    uint32_t flags;
> +    uint64_t flags;
>  
>      flags = env->flags
>              | (env->fpscr & TB_FLAG_FPSCR_MASK)
> diff --git a/target/sh4/translate.c b/target/sh4/translate.c
> index 5729a757f191..0f43a5dced14 100644
> --- a/target/sh4/translate.c
> +++ b/target/sh4/translate.c
> @@ -36,7 +36,7 @@
>  typedef struct DisasContext {
>      DisasContextBase base;
>  
> -    uint32_t tbflags;  /* should stay unmodified during the TB translation */
> +    uint64_t tbflags;  /* should stay unmodified during the TB translation */
>      uint32_t envflags; /* should stay in sync with env->flags using TCG ops */
>      int memidx;
>      int gbank;
> @@ -2177,7 +2177,7 @@ static void decode_gusa(DisasContext *ctx, CPUSH4State *env)
>  static void sh4_tr_init_disas_context(DisasContextBase *dcbase, CPUState *cs)
>  {
>      DisasContext *ctx = container_of(dcbase, DisasContext, base);
> -    uint32_t tbflags;
> +    uint64_t tbflags;
>      int bound;
>  
>      ctx->tbflags = tbflags = ctx->base.tb->flags;
> -- 
> 2.55.0
> 

Reviewed-by: Anton Johansson <anjo@rev.ng>


^ permalink raw reply	[flat|nested] 102+ messages in thread

* Re: [PATCH 20/24] target/sh4: Use 64-bit TB flags
@ 2026-11-27 11:29     ` Anton Johansson via
  0 siblings, 0 replies; 102+ messages in thread
From: Anton Johansson via qemu development @ 2026-11-27 11:29 UTC (permalink / raw)
  To: Philippe Mathieu-Daudé
  Cc: qemu-devel, Richard Henderson, qemu-riscv, qemu-s390x, qemu-arm,
	qemu-ppc, Pierrick Bouvier, Yoshinori Sato

On 27/11/26, Philippe Mathieu-Daudé wrote:
> TranslationBlock::flags and TCGTBCPUState::flags are now
> 64-bit, use matching types for the values derived from them.
> 
> Signed-off-by: Philippe Mathieu-Daudé <philmd@oss.qualcomm.com>
> ---
>  target/sh4/cpu.c       | 2 +-
>  target/sh4/translate.c | 4 ++--
>  2 files changed, 3 insertions(+), 3 deletions(-)
> 
> diff --git a/target/sh4/cpu.c b/target/sh4/cpu.c
> index 17731935779e..90e3e4d52b82 100644
> --- a/target/sh4/cpu.c
> +++ b/target/sh4/cpu.c
> @@ -47,7 +47,7 @@ static vaddr superh_cpu_get_pc(CPUState *cs)
>  static TCGTBCPUState superh_get_tb_cpu_state(CPUState *cs)
>  {
>      CPUSH4State *env = cpu_env(cs);
> -    uint32_t flags;
> +    uint64_t flags;
>  
>      flags = env->flags
>              | (env->fpscr & TB_FLAG_FPSCR_MASK)
> diff --git a/target/sh4/translate.c b/target/sh4/translate.c
> index 5729a757f191..0f43a5dced14 100644
> --- a/target/sh4/translate.c
> +++ b/target/sh4/translate.c
> @@ -36,7 +36,7 @@
>  typedef struct DisasContext {
>      DisasContextBase base;
>  
> -    uint32_t tbflags;  /* should stay unmodified during the TB translation */
> +    uint64_t tbflags;  /* should stay unmodified during the TB translation */
>      uint32_t envflags; /* should stay in sync with env->flags using TCG ops */
>      int memidx;
>      int gbank;
> @@ -2177,7 +2177,7 @@ static void decode_gusa(DisasContext *ctx, CPUSH4State *env)
>  static void sh4_tr_init_disas_context(DisasContextBase *dcbase, CPUState *cs)
>  {
>      DisasContext *ctx = container_of(dcbase, DisasContext, base);
> -    uint32_t tbflags;
> +    uint64_t tbflags;
>      int bound;
>  
>      ctx->tbflags = tbflags = ctx->base.tb->flags;
> -- 
> 2.55.0
> 

Reviewed-by: Anton Johansson <anjo@rev.ng>


^ permalink raw reply	[flat|nested] 102+ messages in thread

* Re: [PATCH 21/24] target/sparc: Use 64-bit TB flags
  2026-11-26 23:35 ` [PATCH 21/24] target/sparc: " Philippe Mathieu-Daudé
  2026-11-27 11:30     ` Anton Johansson via
@ 2026-11-27 11:30     ` Anton Johansson via
  0 siblings, 0 replies; 102+ messages in thread
From: Anton Johansson via @ 2026-11-27 11:30 UTC (permalink / raw)
  To: Philippe Mathieu-Daudé
  Cc: qemu-devel, Richard Henderson, qemu-riscv, qemu-s390x, qemu-arm,
	qemu-ppc, Pierrick Bouvier, Mark Cave-Ayland, Artyom Tarasenko

On 27/11/26, Philippe Mathieu-Daudé wrote:
> TranslationBlock::flags and TCGTBCPUState::flags are now
> 64-bit, use matching types for the values derived from them.
> 
> Signed-off-by: Philippe Mathieu-Daudé <philmd@oss.qualcomm.com>
> ---
>  target/sparc/cpu.h | 4 ++--
>  target/sparc/cpu.c | 4 ++--
>  2 files changed, 4 insertions(+), 4 deletions(-)

Reviewed-by: Anton Johansson <anjo@rev.ng>


^ permalink raw reply	[flat|nested] 102+ messages in thread

* Re: [PATCH 21/24] target/sparc: Use 64-bit TB flags
@ 2026-11-27 11:30     ` Anton Johansson via
  0 siblings, 0 replies; 102+ messages in thread
From: Anton Johansson via @ 2026-11-27 11:30 UTC (permalink / raw)
  To: Philippe Mathieu-Daudé
  Cc: qemu-devel, Richard Henderson, qemu-riscv, qemu-s390x, qemu-arm,
	qemu-ppc, Pierrick Bouvier, Mark Cave-Ayland, Artyom Tarasenko

On 27/11/26, Philippe Mathieu-Daudé wrote:
> TranslationBlock::flags and TCGTBCPUState::flags are now
> 64-bit, use matching types for the values derived from them.
> 
> Signed-off-by: Philippe Mathieu-Daudé <philmd@oss.qualcomm.com>
> ---
>  target/sparc/cpu.h | 4 ++--
>  target/sparc/cpu.c | 4 ++--
>  2 files changed, 4 insertions(+), 4 deletions(-)

Reviewed-by: Anton Johansson <anjo@rev.ng>


^ permalink raw reply	[flat|nested] 102+ messages in thread

* Re: [PATCH 21/24] target/sparc: Use 64-bit TB flags
@ 2026-11-27 11:30     ` Anton Johansson via
  0 siblings, 0 replies; 102+ messages in thread
From: Anton Johansson via qemu development @ 2026-11-27 11:30 UTC (permalink / raw)
  To: Philippe Mathieu-Daudé
  Cc: qemu-devel, Richard Henderson, qemu-riscv, qemu-s390x, qemu-arm,
	qemu-ppc, Pierrick Bouvier, Mark Cave-Ayland, Artyom Tarasenko

On 27/11/26, Philippe Mathieu-Daudé wrote:
> TranslationBlock::flags and TCGTBCPUState::flags are now
> 64-bit, use matching types for the values derived from them.
> 
> Signed-off-by: Philippe Mathieu-Daudé <philmd@oss.qualcomm.com>
> ---
>  target/sparc/cpu.h | 4 ++--
>  target/sparc/cpu.c | 4 ++--
>  2 files changed, 4 insertions(+), 4 deletions(-)

Reviewed-by: Anton Johansson <anjo@rev.ng>


^ permalink raw reply	[flat|nested] 102+ messages in thread

* Re: [PATCH 22/24] target/tricore: Use 64-bit TB flags
  2026-11-26 23:36 ` [PATCH 22/24] target/tricore: " Philippe Mathieu-Daudé
  2026-11-27 11:31     ` Anton Johansson via
@ 2026-11-27 11:31     ` Anton Johansson via
  0 siblings, 0 replies; 102+ messages in thread
From: Anton Johansson via @ 2026-11-27 11:31 UTC (permalink / raw)
  To: Philippe Mathieu-Daudé
  Cc: qemu-devel, Richard Henderson, qemu-riscv, qemu-s390x, qemu-arm,
	qemu-ppc, Pierrick Bouvier

On 27/11/26, Philippe Mathieu-Daudé wrote:
> TranslationBlock::flags and TCGTBCPUState::flags are now
> 64-bit, use matching types for the values derived from them.
> 
> Signed-off-by: Philippe Mathieu-Daudé <philmd@oss.qualcomm.com>
> ---
>  target/tricore/cpu.c       | 2 +-
>  target/tricore/translate.c | 4 ++--
>  2 files changed, 3 insertions(+), 3 deletions(-)
> 
> diff --git a/target/tricore/cpu.c b/target/tricore/cpu.c
> index fa782f82f00e..b77ad96fe7bb 100644
> --- a/target/tricore/cpu.c
> +++ b/target/tricore/cpu.c
> @@ -81,7 +81,7 @@ static TCGTBCPUState tricore_get_tb_cpu_state(CPUState *cs)
>  
>      return (TCGTBCPUState){
>          .pc = env->PC,
> -        .flags = FIELD_DP32(0, TB_FLAGS, PRIV, extract32(env->PSW, 10, 2)),
> +        .flags = FIELD_DP64(0, TB_FLAGS, PRIV, extract32(env->PSW, 10, 2)),
>      };
>  }
>  
> diff --git a/target/tricore/translate.c b/target/tricore/translate.c
> index 8cd6b58f66be..7f343d5626e6 100644
> --- a/target/tricore/translate.c
> +++ b/target/tricore/translate.c
> @@ -8389,8 +8389,8 @@ static void tricore_tr_init_disas_context(DisasContextBase *dcbase,
>      CPUTriCoreState *env = cpu_env(cs);
>      ctx->mem_idx = cpu_mmu_index(cs, false);
>  
> -    uint32_t tb_flags = (uint32_t)ctx->base.tb->flags;
> -    ctx->priv = FIELD_EX32(tb_flags, TB_FLAGS, PRIV);
> +    uint64_t tb_flags = ctx->base.tb->flags;
> +    ctx->priv = FIELD_EX64(tb_flags, TB_FLAGS, PRIV);
>  
>      ctx->features = env->features;
>      if (has_feature(ctx, TRICORE_FEATURE_161)) {
> -- 
> 2.55.0
> 
> 

Reviewed-by: Anton Johansson <anjo@rev.ng>


^ permalink raw reply	[flat|nested] 102+ messages in thread

* Re: [PATCH 22/24] target/tricore: Use 64-bit TB flags
@ 2026-11-27 11:31     ` Anton Johansson via
  0 siblings, 0 replies; 102+ messages in thread
From: Anton Johansson via @ 2026-11-27 11:31 UTC (permalink / raw)
  To: Philippe Mathieu-Daudé
  Cc: qemu-devel, Richard Henderson, qemu-riscv, qemu-s390x, qemu-arm,
	qemu-ppc, Pierrick Bouvier

On 27/11/26, Philippe Mathieu-Daudé wrote:
> TranslationBlock::flags and TCGTBCPUState::flags are now
> 64-bit, use matching types for the values derived from them.
> 
> Signed-off-by: Philippe Mathieu-Daudé <philmd@oss.qualcomm.com>
> ---
>  target/tricore/cpu.c       | 2 +-
>  target/tricore/translate.c | 4 ++--
>  2 files changed, 3 insertions(+), 3 deletions(-)
> 
> diff --git a/target/tricore/cpu.c b/target/tricore/cpu.c
> index fa782f82f00e..b77ad96fe7bb 100644
> --- a/target/tricore/cpu.c
> +++ b/target/tricore/cpu.c
> @@ -81,7 +81,7 @@ static TCGTBCPUState tricore_get_tb_cpu_state(CPUState *cs)
>  
>      return (TCGTBCPUState){
>          .pc = env->PC,
> -        .flags = FIELD_DP32(0, TB_FLAGS, PRIV, extract32(env->PSW, 10, 2)),
> +        .flags = FIELD_DP64(0, TB_FLAGS, PRIV, extract32(env->PSW, 10, 2)),
>      };
>  }
>  
> diff --git a/target/tricore/translate.c b/target/tricore/translate.c
> index 8cd6b58f66be..7f343d5626e6 100644
> --- a/target/tricore/translate.c
> +++ b/target/tricore/translate.c
> @@ -8389,8 +8389,8 @@ static void tricore_tr_init_disas_context(DisasContextBase *dcbase,
>      CPUTriCoreState *env = cpu_env(cs);
>      ctx->mem_idx = cpu_mmu_index(cs, false);
>  
> -    uint32_t tb_flags = (uint32_t)ctx->base.tb->flags;
> -    ctx->priv = FIELD_EX32(tb_flags, TB_FLAGS, PRIV);
> +    uint64_t tb_flags = ctx->base.tb->flags;
> +    ctx->priv = FIELD_EX64(tb_flags, TB_FLAGS, PRIV);
>  
>      ctx->features = env->features;
>      if (has_feature(ctx, TRICORE_FEATURE_161)) {
> -- 
> 2.55.0
> 
> 

Reviewed-by: Anton Johansson <anjo@rev.ng>


^ permalink raw reply	[flat|nested] 102+ messages in thread

* Re: [PATCH 22/24] target/tricore: Use 64-bit TB flags
@ 2026-11-27 11:31     ` Anton Johansson via
  0 siblings, 0 replies; 102+ messages in thread
From: Anton Johansson via qemu development @ 2026-11-27 11:31 UTC (permalink / raw)
  To: Philippe Mathieu-Daudé
  Cc: qemu-devel, Richard Henderson, qemu-riscv, qemu-s390x, qemu-arm,
	qemu-ppc, Pierrick Bouvier

On 27/11/26, Philippe Mathieu-Daudé wrote:
> TranslationBlock::flags and TCGTBCPUState::flags are now
> 64-bit, use matching types for the values derived from them.
> 
> Signed-off-by: Philippe Mathieu-Daudé <philmd@oss.qualcomm.com>
> ---
>  target/tricore/cpu.c       | 2 +-
>  target/tricore/translate.c | 4 ++--
>  2 files changed, 3 insertions(+), 3 deletions(-)
> 
> diff --git a/target/tricore/cpu.c b/target/tricore/cpu.c
> index fa782f82f00e..b77ad96fe7bb 100644
> --- a/target/tricore/cpu.c
> +++ b/target/tricore/cpu.c
> @@ -81,7 +81,7 @@ static TCGTBCPUState tricore_get_tb_cpu_state(CPUState *cs)
>  
>      return (TCGTBCPUState){
>          .pc = env->PC,
> -        .flags = FIELD_DP32(0, TB_FLAGS, PRIV, extract32(env->PSW, 10, 2)),
> +        .flags = FIELD_DP64(0, TB_FLAGS, PRIV, extract32(env->PSW, 10, 2)),
>      };
>  }
>  
> diff --git a/target/tricore/translate.c b/target/tricore/translate.c
> index 8cd6b58f66be..7f343d5626e6 100644
> --- a/target/tricore/translate.c
> +++ b/target/tricore/translate.c
> @@ -8389,8 +8389,8 @@ static void tricore_tr_init_disas_context(DisasContextBase *dcbase,
>      CPUTriCoreState *env = cpu_env(cs);
>      ctx->mem_idx = cpu_mmu_index(cs, false);
>  
> -    uint32_t tb_flags = (uint32_t)ctx->base.tb->flags;
> -    ctx->priv = FIELD_EX32(tb_flags, TB_FLAGS, PRIV);
> +    uint64_t tb_flags = ctx->base.tb->flags;
> +    ctx->priv = FIELD_EX64(tb_flags, TB_FLAGS, PRIV);
>  
>      ctx->features = env->features;
>      if (has_feature(ctx, TRICORE_FEATURE_161)) {
> -- 
> 2.55.0
> 
> 

Reviewed-by: Anton Johansson <anjo@rev.ng>


^ permalink raw reply	[flat|nested] 102+ messages in thread

* Re: [PATCH 23/24] target/xtensa: Use 64-bit TB flags
  2026-11-26 23:36 ` [PATCH 23/24] target/xtensa: " Philippe Mathieu-Daudé
  2026-11-27 11:32     ` Anton Johansson via
@ 2026-11-27 11:32     ` Anton Johansson via
  0 siblings, 0 replies; 102+ messages in thread
From: Anton Johansson via qemu development @ 2026-11-27 11:32 UTC (permalink / raw)
  To: Philippe Mathieu-Daudé
  Cc: qemu-devel, Richard Henderson, qemu-riscv, qemu-s390x, qemu-arm,
	qemu-ppc, Pierrick Bouvier, Max Filippov

On 27/11/26, Philippe Mathieu-Daudé wrote:
> TranslationBlock::flags and TCGTBCPUState::flags are now
> 64-bit, use matching types for the values derived from them.
> 
> Signed-off-by: Philippe Mathieu-Daudé <philmd@oss.qualcomm.com>
> ---
>  target/xtensa/cpu.c       | 2 +-
>  target/xtensa/translate.c | 2 +-
>  2 files changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/target/xtensa/cpu.c b/target/xtensa/cpu.c
> index c193396928f9..33054c81ca48 100644
> --- a/target/xtensa/cpu.c
> +++ b/target/xtensa/cpu.c
> @@ -60,7 +60,7 @@ static vaddr xtensa_cpu_get_pc(CPUState *cs)
>  static TCGTBCPUState xtensa_get_tb_cpu_state(CPUState *cs)
>  {
>      CPUXtensaState *env = cpu_env(cs);
> -    uint32_t flags = 0;
> +    uint64_t flags = 0;
>      uint64_t cs_base = 0;
>  
>      flags |= xtensa_get_ring(env);
> diff --git a/target/xtensa/translate.c b/target/xtensa/translate.c
> index 175fd4b5cfc2..57392ffd8319 100644
> --- a/target/xtensa/translate.c
> +++ b/target/xtensa/translate.c
> @@ -1121,7 +1121,7 @@ static void xtensa_tr_init_disas_context(DisasContextBase *dcbase,
>                                           CPUState *cpu)
>  {
>      DisasContext *dc = container_of(dcbase, DisasContext, base);
> -    uint32_t tb_flags = dc->base.tb->flags;
> +    uint64_t tb_flags = dc->base.tb->flags;
>  
>      dc->config = cpu_env(cpu)->config;
>      dc->pc = dc->base.pc_first;
> -- 
> 2.55.0
> 
> 

Reviewed-by: Anton Johansson <anjo@rev.ng>


^ permalink raw reply	[flat|nested] 102+ messages in thread

* Re: [PATCH 23/24] target/xtensa: Use 64-bit TB flags
@ 2026-11-27 11:32     ` Anton Johansson via
  0 siblings, 0 replies; 102+ messages in thread
From: Anton Johansson via @ 2026-11-27 11:32 UTC (permalink / raw)
  To: Philippe Mathieu-Daudé
  Cc: qemu-devel, Richard Henderson, qemu-riscv, qemu-s390x, qemu-arm,
	qemu-ppc, Pierrick Bouvier, Max Filippov

On 27/11/26, Philippe Mathieu-Daudé wrote:
> TranslationBlock::flags and TCGTBCPUState::flags are now
> 64-bit, use matching types for the values derived from them.
> 
> Signed-off-by: Philippe Mathieu-Daudé <philmd@oss.qualcomm.com>
> ---
>  target/xtensa/cpu.c       | 2 +-
>  target/xtensa/translate.c | 2 +-
>  2 files changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/target/xtensa/cpu.c b/target/xtensa/cpu.c
> index c193396928f9..33054c81ca48 100644
> --- a/target/xtensa/cpu.c
> +++ b/target/xtensa/cpu.c
> @@ -60,7 +60,7 @@ static vaddr xtensa_cpu_get_pc(CPUState *cs)
>  static TCGTBCPUState xtensa_get_tb_cpu_state(CPUState *cs)
>  {
>      CPUXtensaState *env = cpu_env(cs);
> -    uint32_t flags = 0;
> +    uint64_t flags = 0;
>      uint64_t cs_base = 0;
>  
>      flags |= xtensa_get_ring(env);
> diff --git a/target/xtensa/translate.c b/target/xtensa/translate.c
> index 175fd4b5cfc2..57392ffd8319 100644
> --- a/target/xtensa/translate.c
> +++ b/target/xtensa/translate.c
> @@ -1121,7 +1121,7 @@ static void xtensa_tr_init_disas_context(DisasContextBase *dcbase,
>                                           CPUState *cpu)
>  {
>      DisasContext *dc = container_of(dcbase, DisasContext, base);
> -    uint32_t tb_flags = dc->base.tb->flags;
> +    uint64_t tb_flags = dc->base.tb->flags;
>  
>      dc->config = cpu_env(cpu)->config;
>      dc->pc = dc->base.pc_first;
> -- 
> 2.55.0
> 
> 

Reviewed-by: Anton Johansson <anjo@rev.ng>


^ permalink raw reply	[flat|nested] 102+ messages in thread

* Re: [PATCH 23/24] target/xtensa: Use 64-bit TB flags
@ 2026-11-27 11:32     ` Anton Johansson via
  0 siblings, 0 replies; 102+ messages in thread
From: Anton Johansson via @ 2026-11-27 11:32 UTC (permalink / raw)
  To: Philippe Mathieu-Daudé
  Cc: qemu-devel, Richard Henderson, qemu-riscv, qemu-s390x, qemu-arm,
	qemu-ppc, Pierrick Bouvier, Max Filippov

On 27/11/26, Philippe Mathieu-Daudé wrote:
> TranslationBlock::flags and TCGTBCPUState::flags are now
> 64-bit, use matching types for the values derived from them.
> 
> Signed-off-by: Philippe Mathieu-Daudé <philmd@oss.qualcomm.com>
> ---
>  target/xtensa/cpu.c       | 2 +-
>  target/xtensa/translate.c | 2 +-
>  2 files changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/target/xtensa/cpu.c b/target/xtensa/cpu.c
> index c193396928f9..33054c81ca48 100644
> --- a/target/xtensa/cpu.c
> +++ b/target/xtensa/cpu.c
> @@ -60,7 +60,7 @@ static vaddr xtensa_cpu_get_pc(CPUState *cs)
>  static TCGTBCPUState xtensa_get_tb_cpu_state(CPUState *cs)
>  {
>      CPUXtensaState *env = cpu_env(cs);
> -    uint32_t flags = 0;
> +    uint64_t flags = 0;
>      uint64_t cs_base = 0;
>  
>      flags |= xtensa_get_ring(env);
> diff --git a/target/xtensa/translate.c b/target/xtensa/translate.c
> index 175fd4b5cfc2..57392ffd8319 100644
> --- a/target/xtensa/translate.c
> +++ b/target/xtensa/translate.c
> @@ -1121,7 +1121,7 @@ static void xtensa_tr_init_disas_context(DisasContextBase *dcbase,
>                                           CPUState *cpu)
>  {
>      DisasContext *dc = container_of(dcbase, DisasContext, base);
> -    uint32_t tb_flags = dc->base.tb->flags;
> +    uint64_t tb_flags = dc->base.tb->flags;
>  
>      dc->config = cpu_env(cpu)->config;
>      dc->pc = dc->base.pc_first;
> -- 
> 2.55.0
> 
> 

Reviewed-by: Anton Johansson <anjo@rev.ng>


^ permalink raw reply	[flat|nested] 102+ messages in thread

* Re: [PATCH 24/24] accel/tcg: Update TranslationBlock::cs_base description
  2026-11-26 23:36 ` [PATCH 24/24] accel/tcg: Update TranslationBlock::cs_base description Philippe Mathieu-Daudé
  2026-11-27 11:34     ` Anton Johansson via
@ 2026-11-27 11:34     ` Anton Johansson via
  0 siblings, 0 replies; 102+ messages in thread
From: Anton Johansson via @ 2026-11-27 11:34 UTC (permalink / raw)
  To: Philippe Mathieu-Daudé
  Cc: qemu-devel, Richard Henderson, qemu-riscv, qemu-s390x, qemu-arm,
	qemu-ppc, Pierrick Bouvier

On 27/11/26, Philippe Mathieu-Daudé wrote:
> Describe the current TranslationBlock::cs_base users.
> 
> Commits that introduced target use of cs_base:
>   arm:        a378206a205a target/arm: Move mode specific TB flags to tb->cs_base
>   hppa:       c301f34e798e target/hppa: Implement IASQ
>               ebd0e151149a target/hppa: Include priv level in user-only iaoq
>   microblaze: d7ecb757d199 target/microblaze: Ensure imm constant is always available
>   riscv:      55b490b58fbf target/riscv: Record misa_ext in TCGTBCPUState.cs_base
>               1c88ab9e77bd target/riscv: Use the tb->cs_base as the extend tb flags
>   s390x:      303c681a8f50 target/s390x: Implement EXECUTE via new TranslationBlock
>   sh4:        4bfa602bc222 target/sh4: Handle user-space atomics
>   sparc:      b453b70bd8e6 sparc fixes (first commit matching cs_base = env->npc)
>   xtensa:     5d630cef4f91 target/xtensa: rework zero overhead loops implementation
> 
> Signed-off-by: Philippe Mathieu-Daudé <philmd@oss.qualcomm.com>
> ---
>  include/exec/translation-block.h | 15 +++++++++++----
>  1 file changed, 11 insertions(+), 4 deletions(-)
> 
> diff --git a/include/exec/translation-block.h b/include/exec/translation-block.h
> index 491de24d71b9..8fca1bd92267 100644
> --- a/include/exec/translation-block.h
> +++ b/include/exec/translation-block.h
> @@ -60,12 +60,19 @@ struct TranslationBlock {
>      vaddr pc;
>  
>      /*
> -     * Target-specific data associated with the TranslationBlock, e.g.:
> -     * x86: the original user, the Code Segment virtual base,
> -     * arm: an extension of tb->flags,
> +     * cs_base: target-specific data associated with the TranslationBlock,
> +     * as returned by cpu_get_tb_cpu_state() and part of the lookup key.
> +     *
> +     * Targets using it:
> +     * x86: the Code Segment virtual base (0 in 64-bit mode),
> +     * arm: an extension of tb->flags (CPUARMTBFlags::flags2),
> +     * hppa: the CS_BASE_DIFF* bits and the IAOQ_B page offset,
> +     * microblaze: the IMM prefix value,
> +     * riscv: misa_ext (lookup key only, not read by the translator),
>       * s390x: instruction data for EXECUTE,
> +     * sh4: r0 (gUSA region end) when in a gUSA sequence (user-only),
>       * sparc: the next pc of the instruction queue (for delay slots),
> -     * riscv: misa_ext.
> +     * xtensa: zero-overhead loop end distance and loop begin offset.
>       */
>      uint64_t cs_base;
>  
> -- 
> 2.55.0
> 

Reviewed-by: Anton Johansson <anjo@rev.ng>


^ permalink raw reply	[flat|nested] 102+ messages in thread

* Re: [PATCH 24/24] accel/tcg: Update TranslationBlock::cs_base description
@ 2026-11-27 11:34     ` Anton Johansson via
  0 siblings, 0 replies; 102+ messages in thread
From: Anton Johansson via @ 2026-11-27 11:34 UTC (permalink / raw)
  To: Philippe Mathieu-Daudé
  Cc: qemu-devel, Richard Henderson, qemu-riscv, qemu-s390x, qemu-arm,
	qemu-ppc, Pierrick Bouvier

On 27/11/26, Philippe Mathieu-Daudé wrote:
> Describe the current TranslationBlock::cs_base users.
> 
> Commits that introduced target use of cs_base:
>   arm:        a378206a205a target/arm: Move mode specific TB flags to tb->cs_base
>   hppa:       c301f34e798e target/hppa: Implement IASQ
>               ebd0e151149a target/hppa: Include priv level in user-only iaoq
>   microblaze: d7ecb757d199 target/microblaze: Ensure imm constant is always available
>   riscv:      55b490b58fbf target/riscv: Record misa_ext in TCGTBCPUState.cs_base
>               1c88ab9e77bd target/riscv: Use the tb->cs_base as the extend tb flags
>   s390x:      303c681a8f50 target/s390x: Implement EXECUTE via new TranslationBlock
>   sh4:        4bfa602bc222 target/sh4: Handle user-space atomics
>   sparc:      b453b70bd8e6 sparc fixes (first commit matching cs_base = env->npc)
>   xtensa:     5d630cef4f91 target/xtensa: rework zero overhead loops implementation
> 
> Signed-off-by: Philippe Mathieu-Daudé <philmd@oss.qualcomm.com>
> ---
>  include/exec/translation-block.h | 15 +++++++++++----
>  1 file changed, 11 insertions(+), 4 deletions(-)
> 
> diff --git a/include/exec/translation-block.h b/include/exec/translation-block.h
> index 491de24d71b9..8fca1bd92267 100644
> --- a/include/exec/translation-block.h
> +++ b/include/exec/translation-block.h
> @@ -60,12 +60,19 @@ struct TranslationBlock {
>      vaddr pc;
>  
>      /*
> -     * Target-specific data associated with the TranslationBlock, e.g.:
> -     * x86: the original user, the Code Segment virtual base,
> -     * arm: an extension of tb->flags,
> +     * cs_base: target-specific data associated with the TranslationBlock,
> +     * as returned by cpu_get_tb_cpu_state() and part of the lookup key.
> +     *
> +     * Targets using it:
> +     * x86: the Code Segment virtual base (0 in 64-bit mode),
> +     * arm: an extension of tb->flags (CPUARMTBFlags::flags2),
> +     * hppa: the CS_BASE_DIFF* bits and the IAOQ_B page offset,
> +     * microblaze: the IMM prefix value,
> +     * riscv: misa_ext (lookup key only, not read by the translator),
>       * s390x: instruction data for EXECUTE,
> +     * sh4: r0 (gUSA region end) when in a gUSA sequence (user-only),
>       * sparc: the next pc of the instruction queue (for delay slots),
> -     * riscv: misa_ext.
> +     * xtensa: zero-overhead loop end distance and loop begin offset.
>       */
>      uint64_t cs_base;
>  
> -- 
> 2.55.0
> 

Reviewed-by: Anton Johansson <anjo@rev.ng>


^ permalink raw reply	[flat|nested] 102+ messages in thread

* Re: [PATCH 24/24] accel/tcg: Update TranslationBlock::cs_base description
@ 2026-11-27 11:34     ` Anton Johansson via
  0 siblings, 0 replies; 102+ messages in thread
From: Anton Johansson via qemu development @ 2026-11-27 11:34 UTC (permalink / raw)
  To: Philippe Mathieu-Daudé
  Cc: qemu-devel, Richard Henderson, qemu-riscv, qemu-s390x, qemu-arm,
	qemu-ppc, Pierrick Bouvier

On 27/11/26, Philippe Mathieu-Daudé wrote:
> Describe the current TranslationBlock::cs_base users.
> 
> Commits that introduced target use of cs_base:
>   arm:        a378206a205a target/arm: Move mode specific TB flags to tb->cs_base
>   hppa:       c301f34e798e target/hppa: Implement IASQ
>               ebd0e151149a target/hppa: Include priv level in user-only iaoq
>   microblaze: d7ecb757d199 target/microblaze: Ensure imm constant is always available
>   riscv:      55b490b58fbf target/riscv: Record misa_ext in TCGTBCPUState.cs_base
>               1c88ab9e77bd target/riscv: Use the tb->cs_base as the extend tb flags
>   s390x:      303c681a8f50 target/s390x: Implement EXECUTE via new TranslationBlock
>   sh4:        4bfa602bc222 target/sh4: Handle user-space atomics
>   sparc:      b453b70bd8e6 sparc fixes (first commit matching cs_base = env->npc)
>   xtensa:     5d630cef4f91 target/xtensa: rework zero overhead loops implementation
> 
> Signed-off-by: Philippe Mathieu-Daudé <philmd@oss.qualcomm.com>
> ---
>  include/exec/translation-block.h | 15 +++++++++++----
>  1 file changed, 11 insertions(+), 4 deletions(-)
> 
> diff --git a/include/exec/translation-block.h b/include/exec/translation-block.h
> index 491de24d71b9..8fca1bd92267 100644
> --- a/include/exec/translation-block.h
> +++ b/include/exec/translation-block.h
> @@ -60,12 +60,19 @@ struct TranslationBlock {
>      vaddr pc;
>  
>      /*
> -     * Target-specific data associated with the TranslationBlock, e.g.:
> -     * x86: the original user, the Code Segment virtual base,
> -     * arm: an extension of tb->flags,
> +     * cs_base: target-specific data associated with the TranslationBlock,
> +     * as returned by cpu_get_tb_cpu_state() and part of the lookup key.
> +     *
> +     * Targets using it:
> +     * x86: the Code Segment virtual base (0 in 64-bit mode),
> +     * arm: an extension of tb->flags (CPUARMTBFlags::flags2),
> +     * hppa: the CS_BASE_DIFF* bits and the IAOQ_B page offset,
> +     * microblaze: the IMM prefix value,
> +     * riscv: misa_ext (lookup key only, not read by the translator),
>       * s390x: instruction data for EXECUTE,
> +     * sh4: r0 (gUSA region end) when in a gUSA sequence (user-only),
>       * sparc: the next pc of the instruction queue (for delay slots),
> -     * riscv: misa_ext.
> +     * xtensa: zero-overhead loop end distance and loop begin offset.
>       */
>      uint64_t cs_base;
>  
> -- 
> 2.55.0
> 

Reviewed-by: Anton Johansson <anjo@rev.ng>


^ permalink raw reply	[flat|nested] 102+ messages in thread

* Re: [PATCH 15/24] target/ppc: Use 64-bit TB flags
  2026-11-27  7:57   ` Chinmay Rath
@ 2026-11-27 12:09     ` Philippe Mathieu-Daudé
  0 siblings, 0 replies; 102+ messages in thread
From: Philippe Mathieu-Daudé @ 2026-11-27 12:09 UTC (permalink / raw)
  To: Chinmay Rath, qemu-devel
  Cc: Richard Henderson, qemu-riscv, qemu-s390x, qemu-arm, qemu-ppc,
	Anton Johansson, Pierrick Bouvier, Nicholas Piggin, Glenn Miles,
	Harsh Prateek Bora

On 27/11/26 08:57, Chinmay Rath wrote:
> 
> On 11/27/26 05:05, Philippe Mathieu-Daudé wrote:
>> TranslationBlock::flags and TCGTBCPUState::flags are now
>> 64-bit, use matching types for the values derived from them.
>>
>> Signed-off-by: Philippe Mathieu-Daudé <philmd@oss.qualcomm.com>
> Hi Philippe,
> Few months back I was wondering why cs_base was used as an extension 
> instead of extending flags to 64 bits. With this series, now I 
> understand that it was to support 32 bit hosts. Thanks for that!
> 
> I was wondering if PPC env's internal hflags should also be extended to 
> 64 bits with this, but I guess that can wait for when we actually have 
> more than 32 bits needed there.
> With that,
> 
> Reviewed-by: Chinmay Rath <rathc@linux.ibm.com>

Thanks!

Easy enough:

-- >8 --
Author: Philippe Mathieu-Daudé <philmd@oss.qualcomm.com>
Date:   Fri Nov 27 12:59:28 2026 +0100

     target/ppc: Widen CPUPPCState::hflags to 64 bits

     env->hflags uses almost all 32 bits: HFLAGS_DMMU_IDX is
     bit 29, and the composite dmmu_idx occupies bits 29..31.
     Widen CPUPPCState::hflags and the helpers accessing it to
     64 bits (adapting format strings), so more hflags can be
     added.

     Suggested-by: Chinmay Rath <rathc@linux.ibm.com>
     Signed-off-by: Philippe Mathieu-Daudé <philmd@oss.qualcomm.com>

diff --git a/target/ppc/cpu.h b/target/ppc/cpu.h
index 0f44096bad77..c8c9578f413f 100644
--- a/target/ppc/cpu.h
+++ b/target/ppc/cpu.h
@@ -1436,3 +1436,3 @@ struct CPUArchState {
      /* These resources are used only in TCG */
-    uint32_t hflags;
+    uint64_t hflags;
      target_ulong hflags_compat_nmsr; /* for migration compatibility */
diff --git a/target/ppc/cpu_init.c b/target/ppc/cpu_init.c
index 7f3036d903ea..8675a8d772f4 100644
--- a/target/ppc/cpu_init.c
+++ b/target/ppc/cpu_init.c
@@ -7610,3 +7610,3 @@ void ppc_cpu_dump_state(CPUState *cs, FILE *f, int 
flags)
      qemu_fprintf(f, "MSR " TARGET_FMT_lx " HID0 " TARGET_FMT_lx "  HF "
-                 "%08x iidx %d didx %d\n",
+                 "%016" PRIx64 " iidx %d didx %d\n",
                   env->msr, env->spr[SPR_HID0], env->hflags,
diff --git a/target/ppc/helper_regs.c b/target/ppc/helper_regs.c
index acf74c543a17..0ed188c4d70b 100644
--- a/target/ppc/helper_regs.c
+++ b/target/ppc/helper_regs.c
@@ -83,5 +83,5 @@ static bool hreg_check_bhrb_enable(CPUPPCState *env)

-static uint32_t hreg_compute_pmu_hflags_value(CPUPPCState *env)
+static uint64_t hreg_compute_pmu_hflags_value(CPUPPCState *env)
  {
-    uint32_t hflags = 0;
+    uint64_t hflags = 0;
  #if defined(TARGET_PPC64)
@@ -116,5 +116,5 @@ static uint32_t 
hreg_compute_pmu_hflags_value(CPUPPCState *env)
  /* Mask of all PMU hflags */
-static uint32_t hreg_compute_pmu_hflags_mask(CPUPPCState *env)
+static uint64_t hreg_compute_pmu_hflags_mask(CPUPPCState *env)
  {
-    uint32_t hflags_mask = 0;
+    uint64_t hflags_mask = 0;
  #if defined(TARGET_PPC64)
@@ -130,3 +130,3 @@ static uint32_t 
hreg_compute_pmu_hflags_mask(CPUPPCState *env)

-static uint32_t hreg_compute_hflags_value(CPUPPCState *env)
+static uint64_t hreg_compute_hflags_value(CPUPPCState *env)
  {
@@ -134,3 +134,3 @@ static uint32_t 
hreg_compute_hflags_value(CPUPPCState *env)
      uint32_t ppc_flags = env->flags;
-    uint32_t hflags = 0;
+    uint64_t hflags = 0;
      uint32_t msr_mask;
@@ -266,9 +266,10 @@ TCGTBCPUState ppc_get_tb_cpu_state(CPUState *cs)
      CPUPPCState *env = cpu_env(cs);
-    uint32_t hflags_current = env->hflags;
+    uint64_t hflags_current = env->hflags;

  #ifdef CONFIG_DEBUG_TCG
-    uint32_t hflags_rebuilt = hreg_compute_hflags_value(env);
+    uint64_t hflags_rebuilt = hreg_compute_hflags_value(env);
      if (unlikely(hflags_current != hflags_rebuilt)) {
          cpu_abort(env_cpu(env),
-                  "TCG hflags mismatch (current:0x%08x rebuilt:0x%08x)\n",
+                  "TCG hflags mismatch "
+                  "(current:0x%016" PRIx64 " rebuilt:0x%016" PRIx64 ")\n",
                    hflags_current, hflags_rebuilt);
---


^ permalink raw reply related	[flat|nested] 102+ messages in thread

* Re: [PATCH 03/24] accel/tcg: Widen TranslationBlock::flags to 64 bits
  2026-11-27 11:03     ` Anton Johansson via
  (?)
  (?)
@ 2026-11-27 12:30     ` Philippe Mathieu-Daudé
  -1 siblings, 0 replies; 102+ messages in thread
From: Philippe Mathieu-Daudé @ 2026-11-27 12:30 UTC (permalink / raw)
  To: Anton Johansson
  Cc: qemu-devel, Richard Henderson, qemu-riscv, qemu-s390x, qemu-arm,
	qemu-ppc, Pierrick Bouvier, Paolo Bonzini

On 27/11/26 12:03, Anton Johansson via qemu development wrote:
> On 27/11/26, Philippe Mathieu-Daudé wrote:
>> 32-bit host support was removed in v11.0.0 (with commit 372ec46b9f
>> "meson: Reject 32-bit hosts"), so there is no reason to keep the TB
>> flags 32-bit. The wider field fills the 4-byte hole between icount
>> and tc, leaving sizeof(TranslationBlock) unchanged. Widen
>> TCGTBCPUState::flags too.
>>
>> Feed the upper 32 bits into the TB hash, and adapt format string.
>>
>> Signed-off-by: Philippe Mathieu-Daudé <philmd@oss.qualcomm.com>
>> ---
>>   accel/tcg/tb-hash.h              | 5 +++--
>>   include/accel/tcg/tb-cpu-state.h | 2 +-
>>   include/exec/translation-block.h | 2 +-
>>   accel/tcg/cpu-exec.c             | 2 +-
>>   4 files changed, 6 insertions(+), 5 deletions(-)
>>
>> diff --git a/accel/tcg/tb-hash.h b/accel/tcg/tb-hash.h
>> index f7b159f04cb6..819b594618aa 100644
>> --- a/accel/tcg/tb-hash.h
>> +++ b/accel/tcg/tb-hash.h
>> @@ -63,9 +63,10 @@ static inline unsigned int tb_jmp_cache_hash_func(vaddr pc)
>>   
>>   static inline
>>   uint32_t tb_hash_func(tb_page_addr_t phys_pc, vaddr pc,
>> -                      uint32_t flags, uint64_t flags2, uint32_t cf_mask)
>> +                      uint64_t flags, uint64_t flags2, uint32_t cf_mask)
>>   {
>> -    return qemu_xxhash8(phys_pc, pc, flags2, flags, cf_mask);
>> +    /* Fold the upper flag bits into the cf_mask slot. */
>> +    return qemu_xxhash8(phys_pc, pc, flags2, flags, cf_mask ^ (flags >> 32));
>>   }
> 
>  From what I can tell, while cf_mask ^ (flags >> 32) does increase the
> probability for hash collisions it should still be extremely rare.
> Currently the only possibility for extra collision is with the riscv ALTFMT,
> BIG_ENDIAN, SDEXT_STEP fields and CF_COUNT_MASK, from what I can tell.

Hmm qemu_xxhash8() takes 256 bits, but the lookup key needs 288.

IIUC your analysis, better to hash the upper 32-bit flags and xor them,
so they don't share slot with cflags, as:

    return qemu_xxhash8(phys_pc, pc, flags2, flags, cflags)
           ^ qemu_xxhash2(flags >> 32).

?

Cost is of one extra xxhash32 on a tb_jmp_cache miss.

I'll rename the misleading 'cf_mask' argument upon respin, we pass
the full cflags since bf253ac606de ("accel/tcg: drop the use of
CF_HASH_MASK and rename params").

> IMO, for the time being this wouldn't cause any real performance issues
> compared to say adding an extra word to qemu_xxhash8().
> 
> Reviewed-by: Anton Johansson <anjo@rev.ng>
> 



^ permalink raw reply	[flat|nested] 102+ messages in thread

* Re: [PATCH 18/24] target/rx: Use 64-bit TB flags
  2026-11-26 23:35 ` [PATCH 18/24] target/rx: Use 64-bit TB flags Philippe Mathieu-Daudé
  2026-11-27 11:27     ` Anton Johansson via
@ 2026-11-28 13:42   ` yoshinori.sato
  1 sibling, 0 replies; 102+ messages in thread
From: yoshinori.sato @ 2026-11-28 13:42 UTC (permalink / raw)
  To: Philippe Mathieu-Daudé
  Cc: qemu-devel, Richard Henderson, qemu-riscv, qemu-s390x, qemu-arm,
	qemu-ppc, Anton Johansson, Pierrick Bouvier

On Fri, 27 Nov 2026 08:35:56 +0900,
Philippe Mathieu-Daudé wrote:
> 
> TranslationBlock::flags and TCGTBCPUState::flags are now
> 64-bit, use matching types for the values derived from them.
> 
> Signed-off-by: Philippe Mathieu-Daudé <philmd@oss.qualcomm.com>
> ---
>  target/rx/cpu.c       |  6 +++---
>  target/rx/translate.c | 16 ++++++++--------
>  2 files changed, 11 insertions(+), 11 deletions(-)
> 
> diff --git a/target/rx/cpu.c b/target/rx/cpu.c
> index c35a98f7cefa..dba253bda9b1 100644
> --- a/target/rx/cpu.c
> +++ b/target/rx/cpu.c
> @@ -47,10 +47,10 @@ static vaddr rx_cpu_get_pc(CPUState *cs)
>  static TCGTBCPUState rx_get_tb_cpu_state(CPUState *cs)
>  {
>      CPURXState *env = cpu_env(cs);
> -    uint32_t flags = 0;
> +    uint64_t flags = 0;
>  
> -    flags = FIELD_DP32(flags, PSW, PM, env->psw_pm);
> -    flags = FIELD_DP32(flags, PSW, U, env->psw_u);
> +    flags = FIELD_DP64(flags, PSW, PM, env->psw_pm);
> +    flags = FIELD_DP64(flags, PSW, U, env->psw_u);
>  
>      return (TCGTBCPUState){ .pc = env->pc, .flags = flags };
>  }
> diff --git a/target/rx/translate.c b/target/rx/translate.c
> index 1bacc7adf929..69547c83cc05 100644
> --- a/target/rx/translate.c
> +++ b/target/rx/translate.c
> @@ -36,7 +36,7 @@ typedef struct DisasContext {
>      DisasContextBase base;
>      CPURXState *env;
>      uint32_t pc;
> -    uint32_t tb_flags;
> +    uint64_t tb_flags;
>  } DisasContext;
>  
>  typedef struct DisasCompare {
> @@ -243,7 +243,7 @@ static TCGv_i32 rx_load_source(DisasContext *ctx, TCGv_i32 mem,
>  /* Processor mode check */
>  static int is_privileged(DisasContext *ctx, int is_exception)
>  {
> -    if (FIELD_EX32(ctx->tb_flags, PSW, PM)) {
> +    if (FIELD_EX64(ctx->tb_flags, PSW, PM)) {
>          if (is_exception) {
>              gen_helper_raise_privilege_violation(tcg_env);
>          }
> @@ -332,7 +332,7 @@ static void move_from_cr(DisasContext *ctx, TCGv_i32 ret, int cr, uint32_t pc)
>          tcg_gen_movi_i32(ret, pc);
>          break;
>      case 2:     /* USP */
> -        if (FIELD_EX32(ctx->tb_flags, PSW, U)) {
> +        if (FIELD_EX64(ctx->tb_flags, PSW, U)) {
>              tcg_gen_mov_i32(ret, cpu_sp);
>          } else {
>              tcg_gen_mov_i32(ret, cpu_usp);
> @@ -348,7 +348,7 @@ static void move_from_cr(DisasContext *ctx, TCGv_i32 ret, int cr, uint32_t pc)
>          tcg_gen_mov_i32(ret, cpu_bpc);
>          break;
>      case 10:    /* ISP */
> -        if (FIELD_EX32(ctx->tb_flags, PSW, U)) {
> +        if (FIELD_EX64(ctx->tb_flags, PSW, U)) {
>              tcg_gen_mov_i32(ret, cpu_isp);
>          } else {
>              tcg_gen_mov_i32(ret, cpu_sp);
> @@ -386,7 +386,7 @@ static void move_to_cr(DisasContext *ctx, TCGv_i32 val, int cr)
>          break;
>      /* case 1: to PC not supported */
>      case 2:     /* USP */
> -        if (FIELD_EX32(ctx->tb_flags, PSW, U)) {
> +        if (FIELD_EX64(ctx->tb_flags, PSW, U)) {
>              tcg_gen_mov_i32(cpu_sp, val);
>          } else {
>              tcg_gen_mov_i32(cpu_usp, val);
> @@ -402,7 +402,7 @@ static void move_to_cr(DisasContext *ctx, TCGv_i32 val, int cr)
>          tcg_gen_mov_i32(cpu_bpc, val);
>          break;
>      case 10:    /* ISP */
> -        if (FIELD_EX32(ctx->tb_flags, PSW, U)) {
> +        if (FIELD_EX64(ctx->tb_flags, PSW, U)) {
>              tcg_gen_mov_i32(cpu_isp, val);
>          } else {
>              tcg_gen_mov_i32(cpu_sp, val);
> @@ -2080,8 +2080,8 @@ static void clrsetpsw(DisasContext *ctx, int cb, int val)
>              ctx->base.is_jmp = DISAS_UPDATE;
>              break;
>          case PSW_U:
> -            if (FIELD_EX32(ctx->tb_flags, PSW, U) != val) {
> -                ctx->tb_flags = FIELD_DP32(ctx->tb_flags, PSW, U, val);
> +            if (FIELD_EX64(ctx->tb_flags, PSW, U) != val) {
> +                ctx->tb_flags = FIELD_DP64(ctx->tb_flags, PSW, U, val);
>                  tcg_gen_movi_i32(cpu_psw_u, val);
>                  tcg_gen_mov_i32(val ? cpu_isp : cpu_usp, cpu_sp);
>                  tcg_gen_mov_i32(cpu_sp, val ? cpu_usp : cpu_isp);
> -- 
> 2.55.0
> 

Reviewed-by: Yoshinori Sato <yoshinori.sato@nifty.com>

-- 
Yosinori Sato


^ permalink raw reply	[flat|nested] 102+ messages in thread

* Re: [PATCH 20/24] target/sh4: Use 64-bit TB flags
  2026-11-26 23:35 ` [PATCH 20/24] target/sh4: " Philippe Mathieu-Daudé
  2026-11-27 11:29     ` Anton Johansson via
@ 2026-11-28 13:42   ` yoshinori.sato
  1 sibling, 0 replies; 102+ messages in thread
From: yoshinori.sato @ 2026-11-28 13:42 UTC (permalink / raw)
  To: Philippe Mathieu-Daudé
  Cc: qemu-devel, Richard Henderson, qemu-riscv, qemu-s390x, qemu-arm,
	qemu-ppc, Anton Johansson, Pierrick Bouvier

On Fri, 27 Nov 2026 08:35:58 +0900,
Philippe Mathieu-Daudé wrote:
> 
> TranslationBlock::flags and TCGTBCPUState::flags are now
> 64-bit, use matching types for the values derived from them.
> 
> Signed-off-by: Philippe Mathieu-Daudé <philmd@oss.qualcomm.com>
> ---
>  target/sh4/cpu.c       | 2 +-
>  target/sh4/translate.c | 4 ++--
>  2 files changed, 3 insertions(+), 3 deletions(-)
> 
> diff --git a/target/sh4/cpu.c b/target/sh4/cpu.c
> index 17731935779e..90e3e4d52b82 100644
> --- a/target/sh4/cpu.c
> +++ b/target/sh4/cpu.c
> @@ -47,7 +47,7 @@ static vaddr superh_cpu_get_pc(CPUState *cs)
>  static TCGTBCPUState superh_get_tb_cpu_state(CPUState *cs)
>  {
>      CPUSH4State *env = cpu_env(cs);
> -    uint32_t flags;
> +    uint64_t flags;
>  
>      flags = env->flags
>              | (env->fpscr & TB_FLAG_FPSCR_MASK)
> diff --git a/target/sh4/translate.c b/target/sh4/translate.c
> index 5729a757f191..0f43a5dced14 100644
> --- a/target/sh4/translate.c
> +++ b/target/sh4/translate.c
> @@ -36,7 +36,7 @@
>  typedef struct DisasContext {
>      DisasContextBase base;
>  
> -    uint32_t tbflags;  /* should stay unmodified during the TB translation */
> +    uint64_t tbflags;  /* should stay unmodified during the TB translation */
>      uint32_t envflags; /* should stay in sync with env->flags using TCG ops */
>      int memidx;
>      int gbank;
> @@ -2177,7 +2177,7 @@ static void decode_gusa(DisasContext *ctx, CPUSH4State *env)
>  static void sh4_tr_init_disas_context(DisasContextBase *dcbase, CPUState *cs)
>  {
>      DisasContext *ctx = container_of(dcbase, DisasContext, base);
> -    uint32_t tbflags;
> +    uint64_t tbflags;
>      int bound;
>  
>      ctx->tbflags = tbflags = ctx->base.tb->flags;
> -- 
> 2.55.0
> 

Reviewed-by: Yoshinori Sato <yoshinori.sato@nifty.com>

-- 
Yosinori Sato


^ permalink raw reply	[flat|nested] 102+ messages in thread

* Re: [PATCH 10/24] target/loongarch: Use 64-bit TB flags
  2026-11-26 23:35 ` [PATCH 10/24] target/loongarch: " Philippe Mathieu-Daudé
  2026-11-27 11:16     ` Anton Johansson via
@ 2026-11-30  1:03   ` Bibo Mao
  1 sibling, 0 replies; 102+ messages in thread
From: Bibo Mao @ 2026-11-30  1:03 UTC (permalink / raw)
  To: Philippe Mathieu-Daudé, qemu-devel
  Cc: Richard Henderson, qemu-riscv, qemu-s390x, qemu-arm, qemu-ppc,
	Anton Johansson, Pierrick Bouvier, Song Gao, Xianglai Li



On 2026/11/27 上午7:35, Philippe Mathieu-Daudé wrote:
> TranslationBlock::flags and TCGTBCPUState::flags are now
> 64-bit, use matching types for the values derived from them.
> 
> Signed-off-by: Philippe Mathieu-Daudé <philmd@oss.qualcomm.com>
> ---
>   target/loongarch/tcg/tcg_cpu.c | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/target/loongarch/tcg/tcg_cpu.c b/target/loongarch/tcg/tcg_cpu.c
> index 0549506035f3..743b682f1fb0 100644
> --- a/target/loongarch/tcg/tcg_cpu.c
> +++ b/target/loongarch/tcg/tcg_cpu.c
> @@ -236,7 +236,7 @@ static TCGTBCPUState loongarch_get_tb_cpu_state(CPUState *cs)
>   {
>       CPULoongArchState *env = cpu_env(cs);
>       CPUSysState *sys = env_sys(env);
> -    uint32_t flags;
> +    uint64_t flags;
>   
>       flags = sys->CSR_CRMD & (R_CSR_CRMD_PLV_MASK | R_CSR_CRMD_PG_MASK);
>       flags |= FIELD_EX64(sys->CSR_EUEN, CSR_EUEN, FPE) * HW_FLAGS_EUEN_FPE;
> 
Reviewed-by: Bibo Mao <maobibo@loongson.cn>



^ permalink raw reply	[flat|nested] 102+ messages in thread

* Re: [PATCH 16/24] target/riscv: Use 64-bit TB flags
  2026-11-26 23:35 ` [PATCH 16/24] target/riscv: " Philippe Mathieu-Daudé
  2026-11-27 11:23     ` Anton Johansson via qemu development
@ 2026-12-01  1:15   ` Alistair Francis
  2026-12-01  1:16   ` Alistair Francis
  2 siblings, 0 replies; 102+ messages in thread
From: Alistair Francis @ 2026-12-01  1:15 UTC (permalink / raw)
  To: philmd@oss.qualcomm.com, qemu-devel@nongnu.org
  Cc: chao.liu@processmission.com, anjo@rev.ng, qemu-arm@nongnu.org,
	qemu-riscv@nongnu.org, palmer@dabbelt.com,
	zhiwei_liu@linux.alibaba.com, qemu-ppc@nongnu.org,
	qemu-s390x@nongnu.org, pierrick.bouvier@oss.qualcomm.com,
	liwei1518@gmail.com, richard.henderson@linaro.org,
	daniel.barboza@oss.qualcomm.com

On Fri, 2026-11-27 at 00:35 +0100, Philippe Mathieu-Daudé wrote:
> TranslationBlock::flags and TCGTBCPUState::flags are now
> 64-bit, use matching types for the values derived from them.
> 
> Signed-off-by: Philippe Mathieu-Daudé <philmd@oss.qualcomm.com>

Reviewed-by: Alistair Francis <alistair.francis@wdc.com>

Alistair

> ---
>  target/riscv/tcg/tcg-cpu.c   | 46 ++++++++++++++++++----------------
> --
>  target/riscv/tcg/translate.c | 42 ++++++++++++++++----------------
>  2 files changed, 44 insertions(+), 44 deletions(-)
> 
> diff --git a/target/riscv/tcg/tcg-cpu.c b/target/riscv/tcg/tcg-cpu.c
> index 5834ec1524f1..362471d7c8e4 100644
> --- a/target/riscv/tcg/tcg-cpu.c
> +++ b/target/riscv/tcg/tcg-cpu.c
> @@ -104,7 +104,7 @@ static TCGTBCPUState
> riscv_get_tb_cpu_state(CPUState *cs)
>      CPURISCVState *env = cpu_env(cs);
>      RISCVCPU *cpu = env_archcpu(env);
>      RISCVExtStatus fs, vs;
> -    uint32_t flags = 0;
> +    uint64_t flags = 0;
>      uint64_t ext_flags = 0;
>      bool pm_signext = riscv_cpu_virt_mem_enabled(env, false);
>  
> @@ -126,19 +126,19 @@ static TCGTBCPUState
> riscv_get_tb_cpu_state(CPUState *cs)
>          uint32_t maxsz = vlmax << vsew;
>          bool vl_eq_vlmax = (env->vstart == 0) && (vlmax == env->vl)
> &&
>                             (maxsz >= 8);
> -        flags = FIELD_DP32(flags, TB_FLAGS, VILL, env->vill);
> -        flags = FIELD_DP32(flags, TB_FLAGS, SEW, vsew);
> -        flags = FIELD_DP32(flags, TB_FLAGS, LMUL,
> +        flags = FIELD_DP64(flags, TB_FLAGS, VILL, env->vill);
> +        flags = FIELD_DP64(flags, TB_FLAGS, SEW, vsew);
> +        flags = FIELD_DP64(flags, TB_FLAGS, LMUL,
>                             FIELD_EX64(env->vtype, VTYPE, VLMUL));
> -        flags = FIELD_DP32(flags, TB_FLAGS, VL_EQ_VLMAX,
> vl_eq_vlmax);
> -        flags = FIELD_DP32(flags, TB_FLAGS, VTA,
> +        flags = FIELD_DP64(flags, TB_FLAGS, VL_EQ_VLMAX,
> vl_eq_vlmax);
> +        flags = FIELD_DP64(flags, TB_FLAGS, VTA,
>                             FIELD_EX64(env->vtype, VTYPE, VTA));
> -        flags = FIELD_DP32(flags, TB_FLAGS, VMA,
> +        flags = FIELD_DP64(flags, TB_FLAGS, VMA,
>                             FIELD_EX64(env->vtype, VTYPE, VMA));
> -        flags = FIELD_DP32(flags, TB_FLAGS, VSTART_EQ_ZERO, env-
> >vstart == 0);
> +        flags = FIELD_DP64(flags, TB_FLAGS, VSTART_EQ_ZERO, env-
> >vstart == 0);
>          ext_flags = FIELD_DP64(ext_flags, EXT_TB_FLAGS, ALTFMT,
> altfmt);
>      } else {
> -        flags = FIELD_DP32(flags, TB_FLAGS, VILL, 1);
> +        flags = FIELD_DP64(flags, TB_FLAGS, VILL, 1);
>      }
>  
>      if (cpu_get_fcfien(env)) {
> @@ -147,26 +147,26 @@ static TCGTBCPUState
> riscv_get_tb_cpu_state(CPUState *cs)
>           * the start of the block is tracked via env->elp. env->elp
>           * is turned on during jalr translation.
>           */
> -        flags = FIELD_DP32(flags, TB_FLAGS, FCFI_LP_EXPECTED, env-
> >elp);
> -        flags = FIELD_DP32(flags, TB_FLAGS, FCFI_ENABLED, 1);
> +        flags = FIELD_DP64(flags, TB_FLAGS, FCFI_LP_EXPECTED, env-
> >elp);
> +        flags = FIELD_DP64(flags, TB_FLAGS, FCFI_ENABLED, 1);
>      }
>  
>      if (cpu_get_bcfien(env)) {
> -        flags = FIELD_DP32(flags, TB_FLAGS, BCFI_ENABLED, 1);
> +        flags = FIELD_DP64(flags, TB_FLAGS, BCFI_ENABLED, 1);
>      }
>  
>  #ifdef CONFIG_USER_ONLY
>      fs = EXT_STATUS_DIRTY;
>      vs = EXT_STATUS_DIRTY;
>  #else
> -    flags = FIELD_DP32(flags, TB_FLAGS, PRIV, env->priv);
> +    flags = FIELD_DP64(flags, TB_FLAGS, PRIV, env->priv);
>  
>      flags |= riscv_env_mmu_index(env, 0);
>      fs = get_field(env->mstatus, MSTATUS_FS);
>      vs = get_field(env->mstatus, MSTATUS_VS);
>  
>      if (env->virt_enabled) {
> -        flags = FIELD_DP32(flags, TB_FLAGS, VIRT_ENABLED, 1);
> +        flags = FIELD_DP64(flags, TB_FLAGS, VIRT_ENABLED, 1);
>          /*
>           * Merge DISABLED and !DIRTY states using MIN.
>           * We will set both fields when dirtying.
> @@ -183,16 +183,16 @@ static TCGTBCPUState
> riscv_get_tb_cpu_state(CPUState *cs)
>  
>      if ((cpu->cfg.debug || cpu->cfg.ext_sdtrig)
>          && !icount_enabled()) {
> -        flags = FIELD_DP32(flags, TB_FLAGS, ITRIGGER, env-
> >itrigger_enabled);
> +        flags = FIELD_DP64(flags, TB_FLAGS, ITRIGGER, env-
> >itrigger_enabled);
>      }
>  #endif
>  
> -    flags = FIELD_DP32(flags, TB_FLAGS, FS, fs);
> -    flags = FIELD_DP32(flags, TB_FLAGS, VS, vs);
> -    flags = FIELD_DP32(flags, TB_FLAGS, XL, env->xl);
> -    flags = FIELD_DP32(flags, TB_FLAGS, AXL, cpu_address_xl(env));
> -    flags = FIELD_DP32(flags, TB_FLAGS, PM_PMM,
> riscv_pm_get_pmm(env));
> -    flags = FIELD_DP32(flags, TB_FLAGS, PM_SIGNEXTEND, pm_signext);
> +    flags = FIELD_DP64(flags, TB_FLAGS, FS, fs);
> +    flags = FIELD_DP64(flags, TB_FLAGS, VS, vs);
> +    flags = FIELD_DP64(flags, TB_FLAGS, XL, env->xl);
> +    flags = FIELD_DP64(flags, TB_FLAGS, AXL, cpu_address_xl(env));
> +    flags = FIELD_DP64(flags, TB_FLAGS, PM_PMM,
> riscv_pm_get_pmm(env));
> +    flags = FIELD_DP64(flags, TB_FLAGS, PM_SIGNEXTEND, pm_signext);
>  
>      ext_flags = FIELD_DP64(ext_flags, EXT_TB_FLAGS, MISA_EXT, env-
> >misa_ext);
>      ext_flags = FIELD_DP64(ext_flags, EXT_TB_FLAGS, BIG_ENDIAN,
> @@ -216,7 +216,7 @@ static void
> riscv_cpu_synchronize_from_tb(CPUState *cs,
>      if (!(tb_cflags(tb) & CF_PCREL)) {
>          RISCVCPU *cpu = RISCV_CPU(cs);
>          CPURISCVState *env = &cpu->env;
> -        RISCVMXL xl = FIELD_EX32(tb->flags, TB_FLAGS, XL);
> +        RISCVMXL xl = FIELD_EX64(tb->flags, TB_FLAGS, XL);
>  
>          tcg_debug_assert(!tcg_cflags_has(cs, CF_PCREL));
>  
> @@ -234,7 +234,7 @@ static void riscv_restore_state_to_opc(CPUState
> *cs,
>  {
>      RISCVCPU *cpu = RISCV_CPU(cs);
>      CPURISCVState *env = &cpu->env;
> -    RISCVMXL xl = FIELD_EX32(tb->flags, TB_FLAGS, XL);
> +    RISCVMXL xl = FIELD_EX64(tb->flags, TB_FLAGS, XL);
>      target_ulong pc;
>  
>      if (tb_cflags(tb) & CF_PCREL) {
> diff --git a/target/riscv/tcg/translate.c
> b/target/riscv/tcg/translate.c
> index 79b0f444efbd..255433593dd9 100644
> --- a/target/riscv/tcg/translate.c
> +++ b/target/riscv/tcg/translate.c
> @@ -1323,45 +1323,45 @@ static void
> riscv_tr_init_disas_context(DisasContextBase *dcbase, CPUState *cs)
>      CPURISCVState *env = cpu_env(cs);
>      RISCVCPUClass *mcc = RISCV_CPU_GET_CLASS(cs);
>      RISCVCPU *cpu = RISCV_CPU(cs);
> -    uint32_t tb_flags = ctx->base.tb->flags;
> +    uint64_t tb_flags = ctx->base.tb->flags;
>      uint64_t ext_tb_flags = ctx->base.tb->cs_base;
>  
>      ctx->pc_save = ctx->base.pc_first;
> -    ctx->priv = FIELD_EX32(tb_flags, TB_FLAGS, PRIV);
> -    ctx->mem_idx = FIELD_EX32(tb_flags, TB_FLAGS, MEM_IDX);
> -    ctx->mstatus_fs = FIELD_EX32(tb_flags, TB_FLAGS, FS);
> -    ctx->mstatus_vs = FIELD_EX32(tb_flags, TB_FLAGS, VS);
> +    ctx->priv = FIELD_EX64(tb_flags, TB_FLAGS, PRIV);
> +    ctx->mem_idx = FIELD_EX64(tb_flags, TB_FLAGS, MEM_IDX);
> +    ctx->mstatus_fs = FIELD_EX64(tb_flags, TB_FLAGS, FS);
> +    ctx->mstatus_vs = FIELD_EX64(tb_flags, TB_FLAGS, VS);
>      ctx->priv_ver = env->priv_ver;
> -    ctx->virt_enabled = FIELD_EX32(tb_flags, TB_FLAGS,
> VIRT_ENABLED);
> +    ctx->virt_enabled = FIELD_EX64(tb_flags, TB_FLAGS,
> VIRT_ENABLED);
>      ctx->misa_ext = env->misa_ext;
>      ctx->frm = -1;  /* unknown rounding mode */
>      ctx->cfg_ptr = &(cpu->cfg);
> -    ctx->vill = FIELD_EX32(tb_flags, TB_FLAGS, VILL);
> -    ctx->sew = FIELD_EX32(tb_flags, TB_FLAGS, SEW);
> -    ctx->lmul = sextract32(FIELD_EX32(tb_flags, TB_FLAGS, LMUL), 0,
> 3);
> -    ctx->vta = FIELD_EX32(tb_flags, TB_FLAGS, VTA) && cpu-
> >cfg.rvv_ta_all_1s;
> -    ctx->vma = FIELD_EX32(tb_flags, TB_FLAGS, VMA) && cpu-
> >cfg.rvv_ma_all_1s;
> +    ctx->vill = FIELD_EX64(tb_flags, TB_FLAGS, VILL);
> +    ctx->sew = FIELD_EX64(tb_flags, TB_FLAGS, SEW);
> +    ctx->lmul = sextract32(FIELD_EX64(tb_flags, TB_FLAGS, LMUL), 0,
> 3);
> +    ctx->vta = FIELD_EX64(tb_flags, TB_FLAGS, VTA) && cpu-
> >cfg.rvv_ta_all_1s;
> +    ctx->vma = FIELD_EX64(tb_flags, TB_FLAGS, VMA) && cpu-
> >cfg.rvv_ma_all_1s;
>      ctx->cfg_vta_all_1s = cpu->cfg.rvv_ta_all_1s;
> -    ctx->vstart_eq_zero = FIELD_EX32(tb_flags, TB_FLAGS,
> VSTART_EQ_ZERO);
> -    ctx->vl_eq_vlmax = FIELD_EX32(tb_flags, TB_FLAGS, VL_EQ_VLMAX);
> +    ctx->vstart_eq_zero = FIELD_EX64(tb_flags, TB_FLAGS,
> VSTART_EQ_ZERO);
> +    ctx->vl_eq_vlmax = FIELD_EX64(tb_flags, TB_FLAGS, VL_EQ_VLMAX);
>      ctx->altfmt = FIELD_EX64(ext_tb_flags, EXT_TB_FLAGS, ALTFMT);
>      ctx->misa_mxl_max = mcc->def->misa_mxl_max;
> -    ctx->xl = FIELD_EX32(tb_flags, TB_FLAGS, XL);
> -    ctx->address_xl = FIELD_EX32(tb_flags, TB_FLAGS, AXL);
> +    ctx->xl = FIELD_EX64(tb_flags, TB_FLAGS, XL);
> +    ctx->address_xl = FIELD_EX64(tb_flags, TB_FLAGS, AXL);
>      ctx->cs = cs;
>      if (get_xl(ctx) == MXL_RV32) {
>          ctx->addr_xl = 32;
>          ctx->addr_signed = false;
>      } else {
> -        int pm_pmm = FIELD_EX32(tb_flags, TB_FLAGS, PM_PMM);
> +        int pm_pmm = FIELD_EX64(tb_flags, TB_FLAGS, PM_PMM);
>          ctx->addr_xl = 64 - riscv_pm_get_pmlen(pm_pmm);
> -        ctx->addr_signed = FIELD_EX32(tb_flags, TB_FLAGS,
> PM_SIGNEXTEND);
> +        ctx->addr_signed = FIELD_EX64(tb_flags, TB_FLAGS,
> PM_SIGNEXTEND);
>      }
>      ctx->ztso = cpu->cfg.ext_ztso;
> -    ctx->itrigger = FIELD_EX32(tb_flags, TB_FLAGS, ITRIGGER);
> -    ctx->bcfi_enabled = FIELD_EX32(tb_flags, TB_FLAGS,
> BCFI_ENABLED);
> -    ctx->fcfi_lp_expected = FIELD_EX32(tb_flags, TB_FLAGS,
> FCFI_LP_EXPECTED);
> -    ctx->fcfi_enabled = FIELD_EX32(tb_flags, TB_FLAGS,
> FCFI_ENABLED);
> +    ctx->itrigger = FIELD_EX64(tb_flags, TB_FLAGS, ITRIGGER);
> +    ctx->bcfi_enabled = FIELD_EX64(tb_flags, TB_FLAGS,
> BCFI_ENABLED);
> +    ctx->fcfi_lp_expected = FIELD_EX64(tb_flags, TB_FLAGS,
> FCFI_LP_EXPECTED);
> +    ctx->fcfi_enabled = FIELD_EX64(tb_flags, TB_FLAGS,
> FCFI_ENABLED);
>      ctx->sdext_step = FIELD_EX64(ext_tb_flags, EXT_TB_FLAGS,
> SDEXT_STEP);
>      ctx->zero = tcg_constant_tl(0);
>      ctx->virt_inst_excp = false;

^ permalink raw reply	[flat|nested] 102+ messages in thread

* Re: [PATCH 16/24] target/riscv: Use 64-bit TB flags
  2026-11-26 23:35 ` [PATCH 16/24] target/riscv: " Philippe Mathieu-Daudé
  2026-11-27 11:23     ` Anton Johansson via qemu development
  2026-12-01  1:15   ` Alistair Francis
@ 2026-12-01  1:16   ` Alistair Francis
  2 siblings, 0 replies; 102+ messages in thread
From: Alistair Francis @ 2026-12-01  1:16 UTC (permalink / raw)
  To: philmd@oss.qualcomm.com, qemu-devel@nongnu.org
  Cc: chao.liu@processmission.com, anjo@rev.ng, qemu-arm@nongnu.org,
	qemu-riscv@nongnu.org, palmer@dabbelt.com,
	zhiwei_liu@linux.alibaba.com, qemu-ppc@nongnu.org,
	qemu-s390x@nongnu.org, pierrick.bouvier@oss.qualcomm.com,
	liwei1518@gmail.com, richard.henderson@linaro.org,
	daniel.barboza@oss.qualcomm.com

On Fri, 2026-11-27 at 00:35 +0100, Philippe Mathieu-Daudé wrote:
> TranslationBlock::flags and TCGTBCPUState::flags are now
> 64-bit, use matching types for the values derived from them.
> 
> Signed-off-by: Philippe Mathieu-Daudé <philmd@oss.qualcomm.com>

Reviewed-by: Alistair Francis <alistair.francis@wdc.com>

Alistair

> ---
>  target/riscv/tcg/tcg-cpu.c   | 46 ++++++++++++++++++----------------
> --
>  target/riscv/tcg/translate.c | 42 ++++++++++++++++----------------
>  2 files changed, 44 insertions(+), 44 deletions(-)
> 
> diff --git a/target/riscv/tcg/tcg-cpu.c b/target/riscv/tcg/tcg-cpu.c
> index 5834ec1524f1..362471d7c8e4 100644
> --- a/target/riscv/tcg/tcg-cpu.c
> +++ b/target/riscv/tcg/tcg-cpu.c
> @@ -104,7 +104,7 @@ static TCGTBCPUState
> riscv_get_tb_cpu_state(CPUState *cs)
>      CPURISCVState *env = cpu_env(cs);
>      RISCVCPU *cpu = env_archcpu(env);
>      RISCVExtStatus fs, vs;
> -    uint32_t flags = 0;
> +    uint64_t flags = 0;
>      uint64_t ext_flags = 0;
>      bool pm_signext = riscv_cpu_virt_mem_enabled(env, false);
>  
> @@ -126,19 +126,19 @@ static TCGTBCPUState
> riscv_get_tb_cpu_state(CPUState *cs)
>          uint32_t maxsz = vlmax << vsew;
>          bool vl_eq_vlmax = (env->vstart == 0) && (vlmax == env->vl)
> &&
>                             (maxsz >= 8);
> -        flags = FIELD_DP32(flags, TB_FLAGS, VILL, env->vill);
> -        flags = FIELD_DP32(flags, TB_FLAGS, SEW, vsew);
> -        flags = FIELD_DP32(flags, TB_FLAGS, LMUL,
> +        flags = FIELD_DP64(flags, TB_FLAGS, VILL, env->vill);
> +        flags = FIELD_DP64(flags, TB_FLAGS, SEW, vsew);
> +        flags = FIELD_DP64(flags, TB_FLAGS, LMUL,
>                             FIELD_EX64(env->vtype, VTYPE, VLMUL));
> -        flags = FIELD_DP32(flags, TB_FLAGS, VL_EQ_VLMAX,
> vl_eq_vlmax);
> -        flags = FIELD_DP32(flags, TB_FLAGS, VTA,
> +        flags = FIELD_DP64(flags, TB_FLAGS, VL_EQ_VLMAX,
> vl_eq_vlmax);
> +        flags = FIELD_DP64(flags, TB_FLAGS, VTA,
>                             FIELD_EX64(env->vtype, VTYPE, VTA));
> -        flags = FIELD_DP32(flags, TB_FLAGS, VMA,
> +        flags = FIELD_DP64(flags, TB_FLAGS, VMA,
>                             FIELD_EX64(env->vtype, VTYPE, VMA));
> -        flags = FIELD_DP32(flags, TB_FLAGS, VSTART_EQ_ZERO, env-
> >vstart == 0);
> +        flags = FIELD_DP64(flags, TB_FLAGS, VSTART_EQ_ZERO, env-
> >vstart == 0);
>          ext_flags = FIELD_DP64(ext_flags, EXT_TB_FLAGS, ALTFMT,
> altfmt);
>      } else {
> -        flags = FIELD_DP32(flags, TB_FLAGS, VILL, 1);
> +        flags = FIELD_DP64(flags, TB_FLAGS, VILL, 1);
>      }
>  
>      if (cpu_get_fcfien(env)) {
> @@ -147,26 +147,26 @@ static TCGTBCPUState
> riscv_get_tb_cpu_state(CPUState *cs)
>           * the start of the block is tracked via env->elp. env->elp
>           * is turned on during jalr translation.
>           */
> -        flags = FIELD_DP32(flags, TB_FLAGS, FCFI_LP_EXPECTED, env-
> >elp);
> -        flags = FIELD_DP32(flags, TB_FLAGS, FCFI_ENABLED, 1);
> +        flags = FIELD_DP64(flags, TB_FLAGS, FCFI_LP_EXPECTED, env-
> >elp);
> +        flags = FIELD_DP64(flags, TB_FLAGS, FCFI_ENABLED, 1);
>      }
>  
>      if (cpu_get_bcfien(env)) {
> -        flags = FIELD_DP32(flags, TB_FLAGS, BCFI_ENABLED, 1);
> +        flags = FIELD_DP64(flags, TB_FLAGS, BCFI_ENABLED, 1);
>      }
>  
>  #ifdef CONFIG_USER_ONLY
>      fs = EXT_STATUS_DIRTY;
>      vs = EXT_STATUS_DIRTY;
>  #else
> -    flags = FIELD_DP32(flags, TB_FLAGS, PRIV, env->priv);
> +    flags = FIELD_DP64(flags, TB_FLAGS, PRIV, env->priv);
>  
>      flags |= riscv_env_mmu_index(env, 0);
>      fs = get_field(env->mstatus, MSTATUS_FS);
>      vs = get_field(env->mstatus, MSTATUS_VS);
>  
>      if (env->virt_enabled) {
> -        flags = FIELD_DP32(flags, TB_FLAGS, VIRT_ENABLED, 1);
> +        flags = FIELD_DP64(flags, TB_FLAGS, VIRT_ENABLED, 1);
>          /*
>           * Merge DISABLED and !DIRTY states using MIN.
>           * We will set both fields when dirtying.
> @@ -183,16 +183,16 @@ static TCGTBCPUState
> riscv_get_tb_cpu_state(CPUState *cs)
>  
>      if ((cpu->cfg.debug || cpu->cfg.ext_sdtrig)
>          && !icount_enabled()) {
> -        flags = FIELD_DP32(flags, TB_FLAGS, ITRIGGER, env-
> >itrigger_enabled);
> +        flags = FIELD_DP64(flags, TB_FLAGS, ITRIGGER, env-
> >itrigger_enabled);
>      }
>  #endif
>  
> -    flags = FIELD_DP32(flags, TB_FLAGS, FS, fs);
> -    flags = FIELD_DP32(flags, TB_FLAGS, VS, vs);
> -    flags = FIELD_DP32(flags, TB_FLAGS, XL, env->xl);
> -    flags = FIELD_DP32(flags, TB_FLAGS, AXL, cpu_address_xl(env));
> -    flags = FIELD_DP32(flags, TB_FLAGS, PM_PMM,
> riscv_pm_get_pmm(env));
> -    flags = FIELD_DP32(flags, TB_FLAGS, PM_SIGNEXTEND, pm_signext);
> +    flags = FIELD_DP64(flags, TB_FLAGS, FS, fs);
> +    flags = FIELD_DP64(flags, TB_FLAGS, VS, vs);
> +    flags = FIELD_DP64(flags, TB_FLAGS, XL, env->xl);
> +    flags = FIELD_DP64(flags, TB_FLAGS, AXL, cpu_address_xl(env));
> +    flags = FIELD_DP64(flags, TB_FLAGS, PM_PMM,
> riscv_pm_get_pmm(env));
> +    flags = FIELD_DP64(flags, TB_FLAGS, PM_SIGNEXTEND, pm_signext);
>  
>      ext_flags = FIELD_DP64(ext_flags, EXT_TB_FLAGS, MISA_EXT, env-
> >misa_ext);
>      ext_flags = FIELD_DP64(ext_flags, EXT_TB_FLAGS, BIG_ENDIAN,
> @@ -216,7 +216,7 @@ static void
> riscv_cpu_synchronize_from_tb(CPUState *cs,
>      if (!(tb_cflags(tb) & CF_PCREL)) {
>          RISCVCPU *cpu = RISCV_CPU(cs);
>          CPURISCVState *env = &cpu->env;
> -        RISCVMXL xl = FIELD_EX32(tb->flags, TB_FLAGS, XL);
> +        RISCVMXL xl = FIELD_EX64(tb->flags, TB_FLAGS, XL);
>  
>          tcg_debug_assert(!tcg_cflags_has(cs, CF_PCREL));
>  
> @@ -234,7 +234,7 @@ static void riscv_restore_state_to_opc(CPUState
> *cs,
>  {
>      RISCVCPU *cpu = RISCV_CPU(cs);
>      CPURISCVState *env = &cpu->env;
> -    RISCVMXL xl = FIELD_EX32(tb->flags, TB_FLAGS, XL);
> +    RISCVMXL xl = FIELD_EX64(tb->flags, TB_FLAGS, XL);
>      target_ulong pc;
>  
>      if (tb_cflags(tb) & CF_PCREL) {
> diff --git a/target/riscv/tcg/translate.c
> b/target/riscv/tcg/translate.c
> index 79b0f444efbd..255433593dd9 100644
> --- a/target/riscv/tcg/translate.c
> +++ b/target/riscv/tcg/translate.c
> @@ -1323,45 +1323,45 @@ static void
> riscv_tr_init_disas_context(DisasContextBase *dcbase, CPUState *cs)
>      CPURISCVState *env = cpu_env(cs);
>      RISCVCPUClass *mcc = RISCV_CPU_GET_CLASS(cs);
>      RISCVCPU *cpu = RISCV_CPU(cs);
> -    uint32_t tb_flags = ctx->base.tb->flags;
> +    uint64_t tb_flags = ctx->base.tb->flags;
>      uint64_t ext_tb_flags = ctx->base.tb->cs_base;
>  
>      ctx->pc_save = ctx->base.pc_first;
> -    ctx->priv = FIELD_EX32(tb_flags, TB_FLAGS, PRIV);
> -    ctx->mem_idx = FIELD_EX32(tb_flags, TB_FLAGS, MEM_IDX);
> -    ctx->mstatus_fs = FIELD_EX32(tb_flags, TB_FLAGS, FS);
> -    ctx->mstatus_vs = FIELD_EX32(tb_flags, TB_FLAGS, VS);
> +    ctx->priv = FIELD_EX64(tb_flags, TB_FLAGS, PRIV);
> +    ctx->mem_idx = FIELD_EX64(tb_flags, TB_FLAGS, MEM_IDX);
> +    ctx->mstatus_fs = FIELD_EX64(tb_flags, TB_FLAGS, FS);
> +    ctx->mstatus_vs = FIELD_EX64(tb_flags, TB_FLAGS, VS);
>      ctx->priv_ver = env->priv_ver;
> -    ctx->virt_enabled = FIELD_EX32(tb_flags, TB_FLAGS,
> VIRT_ENABLED);
> +    ctx->virt_enabled = FIELD_EX64(tb_flags, TB_FLAGS,
> VIRT_ENABLED);
>      ctx->misa_ext = env->misa_ext;
>      ctx->frm = -1;  /* unknown rounding mode */
>      ctx->cfg_ptr = &(cpu->cfg);
> -    ctx->vill = FIELD_EX32(tb_flags, TB_FLAGS, VILL);
> -    ctx->sew = FIELD_EX32(tb_flags, TB_FLAGS, SEW);
> -    ctx->lmul = sextract32(FIELD_EX32(tb_flags, TB_FLAGS, LMUL), 0,
> 3);
> -    ctx->vta = FIELD_EX32(tb_flags, TB_FLAGS, VTA) && cpu-
> >cfg.rvv_ta_all_1s;
> -    ctx->vma = FIELD_EX32(tb_flags, TB_FLAGS, VMA) && cpu-
> >cfg.rvv_ma_all_1s;
> +    ctx->vill = FIELD_EX64(tb_flags, TB_FLAGS, VILL);
> +    ctx->sew = FIELD_EX64(tb_flags, TB_FLAGS, SEW);
> +    ctx->lmul = sextract32(FIELD_EX64(tb_flags, TB_FLAGS, LMUL), 0,
> 3);
> +    ctx->vta = FIELD_EX64(tb_flags, TB_FLAGS, VTA) && cpu-
> >cfg.rvv_ta_all_1s;
> +    ctx->vma = FIELD_EX64(tb_flags, TB_FLAGS, VMA) && cpu-
> >cfg.rvv_ma_all_1s;
>      ctx->cfg_vta_all_1s = cpu->cfg.rvv_ta_all_1s;
> -    ctx->vstart_eq_zero = FIELD_EX32(tb_flags, TB_FLAGS,
> VSTART_EQ_ZERO);
> -    ctx->vl_eq_vlmax = FIELD_EX32(tb_flags, TB_FLAGS, VL_EQ_VLMAX);
> +    ctx->vstart_eq_zero = FIELD_EX64(tb_flags, TB_FLAGS,
> VSTART_EQ_ZERO);
> +    ctx->vl_eq_vlmax = FIELD_EX64(tb_flags, TB_FLAGS, VL_EQ_VLMAX);
>      ctx->altfmt = FIELD_EX64(ext_tb_flags, EXT_TB_FLAGS, ALTFMT);
>      ctx->misa_mxl_max = mcc->def->misa_mxl_max;
> -    ctx->xl = FIELD_EX32(tb_flags, TB_FLAGS, XL);
> -    ctx->address_xl = FIELD_EX32(tb_flags, TB_FLAGS, AXL);
> +    ctx->xl = FIELD_EX64(tb_flags, TB_FLAGS, XL);
> +    ctx->address_xl = FIELD_EX64(tb_flags, TB_FLAGS, AXL);
>      ctx->cs = cs;
>      if (get_xl(ctx) == MXL_RV32) {
>          ctx->addr_xl = 32;
>          ctx->addr_signed = false;
>      } else {
> -        int pm_pmm = FIELD_EX32(tb_flags, TB_FLAGS, PM_PMM);
> +        int pm_pmm = FIELD_EX64(tb_flags, TB_FLAGS, PM_PMM);
>          ctx->addr_xl = 64 - riscv_pm_get_pmlen(pm_pmm);
> -        ctx->addr_signed = FIELD_EX32(tb_flags, TB_FLAGS,
> PM_SIGNEXTEND);
> +        ctx->addr_signed = FIELD_EX64(tb_flags, TB_FLAGS,
> PM_SIGNEXTEND);
>      }
>      ctx->ztso = cpu->cfg.ext_ztso;
> -    ctx->itrigger = FIELD_EX32(tb_flags, TB_FLAGS, ITRIGGER);
> -    ctx->bcfi_enabled = FIELD_EX32(tb_flags, TB_FLAGS,
> BCFI_ENABLED);
> -    ctx->fcfi_lp_expected = FIELD_EX32(tb_flags, TB_FLAGS,
> FCFI_LP_EXPECTED);
> -    ctx->fcfi_enabled = FIELD_EX32(tb_flags, TB_FLAGS,
> FCFI_ENABLED);
> +    ctx->itrigger = FIELD_EX64(tb_flags, TB_FLAGS, ITRIGGER);
> +    ctx->bcfi_enabled = FIELD_EX64(tb_flags, TB_FLAGS,
> BCFI_ENABLED);
> +    ctx->fcfi_lp_expected = FIELD_EX64(tb_flags, TB_FLAGS,
> FCFI_LP_EXPECTED);
> +    ctx->fcfi_enabled = FIELD_EX64(tb_flags, TB_FLAGS,
> FCFI_ENABLED);
>      ctx->sdext_step = FIELD_EX64(ext_tb_flags, EXT_TB_FLAGS,
> SDEXT_STEP);
>      ctx->zero = tcg_constant_tl(0);
>      ctx->virt_inst_excp = false;

^ permalink raw reply	[flat|nested] 102+ messages in thread

* Re: [PATCH 17/24] target/riscv: Partially revert use of tb->cs_base
  2026-11-26 23:35 ` [PATCH 17/24] target/riscv: Partially revert use of tb->cs_base Philippe Mathieu-Daudé
  2026-11-27 11:26     ` Anton Johansson via
@ 2026-12-01  1:18   ` Alistair Francis
  1 sibling, 0 replies; 102+ messages in thread
From: Alistair Francis @ 2026-12-01  1:18 UTC (permalink / raw)
  To: philmd@oss.qualcomm.com, qemu-devel@nongnu.org
  Cc: chao.liu@processmission.com, anjo@rev.ng, qemu-arm@nongnu.org,
	qemu-riscv@nongnu.org, palmer@dabbelt.com,
	zhiwei_liu@linux.alibaba.com, qemu-ppc@nongnu.org,
	qemu-s390x@nongnu.org, pierrick.bouvier@oss.qualcomm.com,
	liwei1518@gmail.com, richard.henderson@linaro.org,
	daniel.barboza@oss.qualcomm.com

On Fri, 2026-11-27 at 00:35 +0100, Philippe Mathieu-Daudé wrote:
> Partially revert commit 1c88ab9e77bd ("target/riscv: Use the
> tb->cs_base as the extend tb flags"): now that
> TranslationBlock::flags
> is 64-bit, keep only misa_ext in tb->cs_base (as in 55b490b58fbf) and
> move the other extended flags (ALTFMT, BIG_ENDIAN, SDEXT_STEP) into
> TB_FLAGS at bits 32+.
> 
> Signed-off-by: Philippe Mathieu-Daudé <philmd@oss.qualcomm.com>

Reviewed-by: Alistair Francis <alistair.francis@wdc.com>

Alistair

> ---
>  include/exec/translation-block.h |  2 +-
>  target/riscv/cpu.h               |  8 +++-----
>  target/riscv/tcg/tcg-cpu.c       | 12 +++++-------
>  target/riscv/tcg/translate.c     |  7 +++----
>  4 files changed, 12 insertions(+), 17 deletions(-)
> 
> diff --git a/include/exec/translation-block.h
> b/include/exec/translation-block.h
> index f9f4876e6dd3..491de24d71b9 100644
> --- a/include/exec/translation-block.h
> +++ b/include/exec/translation-block.h
> @@ -65,7 +65,7 @@ struct TranslationBlock {
>       * arm: an extension of tb->flags,
>       * s390x: instruction data for EXECUTE,
>       * sparc: the next pc of the instruction queue (for delay
> slots),
> -     * riscv: an extension of tb->flags.
> +     * riscv: misa_ext.
>       */
>      uint64_t cs_base;
>  
> diff --git a/target/riscv/cpu.h b/target/riscv/cpu.h
> index 49a1186bdbb2..be5d520e200b 100644
> --- a/target/riscv/cpu.h
> +++ b/target/riscv/cpu.h
> @@ -777,12 +777,10 @@ FIELD(TB_FLAGS, BCFI_ENABLED, 28, 1)
>  /* If pointer masking should be applied and address sign extended */
>  FIELD(TB_FLAGS, PM_PMM, 29, 2)
>  FIELD(TB_FLAGS, PM_SIGNEXTEND, 31, 1)
> -
> -FIELD(EXT_TB_FLAGS, MISA_EXT, 0, 32)
> -FIELD(EXT_TB_FLAGS, ALTFMT, 32, 1)
> -FIELD(EXT_TB_FLAGS, BIG_ENDIAN, 33, 1)
> +FIELD(TB_FLAGS, ALTFMT, 32, 1)
> +FIELD(TB_FLAGS, BIG_ENDIAN, 33, 1)
>  /* sdext single-step needs a TB flag to build 1-insn TBs */
> -FIELD(EXT_TB_FLAGS, SDEXT_STEP, 34, 1)
> +FIELD(TB_FLAGS, SDEXT_STEP, 34, 1)
>  
>  #ifdef TARGET_RISCV32
>  #define riscv_cpu_mxl(env)  ((void)(env), MXL_RV32)
> diff --git a/target/riscv/tcg/tcg-cpu.c b/target/riscv/tcg/tcg-cpu.c
> index 362471d7c8e4..7a06979f9bee 100644
> --- a/target/riscv/tcg/tcg-cpu.c
> +++ b/target/riscv/tcg/tcg-cpu.c
> @@ -105,7 +105,6 @@ static TCGTBCPUState
> riscv_get_tb_cpu_state(CPUState *cs)
>      RISCVCPU *cpu = env_archcpu(env);
>      RISCVExtStatus fs, vs;
>      uint64_t flags = 0;
> -    uint64_t ext_flags = 0;
>      bool pm_signext = riscv_cpu_virt_mem_enabled(env, false);
>  
>      if (cpu->cfg.ext_zve32x) {
> @@ -136,7 +135,7 @@ static TCGTBCPUState
> riscv_get_tb_cpu_state(CPUState *cs)
>          flags = FIELD_DP64(flags, TB_FLAGS, VMA,
>                             FIELD_EX64(env->vtype, VTYPE, VMA));
>          flags = FIELD_DP64(flags, TB_FLAGS, VSTART_EQ_ZERO, env-
> >vstart == 0);
> -        ext_flags = FIELD_DP64(ext_flags, EXT_TB_FLAGS, ALTFMT,
> altfmt);
> +        flags = FIELD_DP64(flags, TB_FLAGS, ALTFMT, altfmt);
>      } else {
>          flags = FIELD_DP64(flags, TB_FLAGS, VILL, 1);
>      }
> @@ -194,19 +193,18 @@ static TCGTBCPUState
> riscv_get_tb_cpu_state(CPUState *cs)
>      flags = FIELD_DP64(flags, TB_FLAGS, PM_PMM,
> riscv_pm_get_pmm(env));
>      flags = FIELD_DP64(flags, TB_FLAGS, PM_SIGNEXTEND, pm_signext);
>  
> -    ext_flags = FIELD_DP64(ext_flags, EXT_TB_FLAGS, MISA_EXT, env-
> >misa_ext);
> -    ext_flags = FIELD_DP64(ext_flags, EXT_TB_FLAGS, BIG_ENDIAN,
> -                           mo_endian_env(env) == MO_BE);
> +    flags = FIELD_DP64(flags, TB_FLAGS, BIG_ENDIAN,
> +                       mo_endian_env(env) == MO_BE);
>  #ifndef CONFIG_USER_ONLY
>      if (cpu->cfg.ext_sdext && !env->debug_mode && (env->dcsr &
> DCSR_STEP)) {
> -        ext_flags = FIELD_DP64(ext_flags, EXT_TB_FLAGS, SDEXT_STEP,
> 1);
> +        flags = FIELD_DP64(flags, TB_FLAGS, SDEXT_STEP, 1);
>      }
>  #endif
>  
>      return (TCGTBCPUState){
>          .pc = env->xl == MXL_RV32 ? env->pc & UINT32_MAX : env->pc,
>          .flags = flags,
> -        .cs_base = ext_flags,
> +        .cs_base = env->misa_ext,
>      };
>  }
>  
> diff --git a/target/riscv/tcg/translate.c
> b/target/riscv/tcg/translate.c
> index 255433593dd9..b810b91dc26a 100644
> --- a/target/riscv/tcg/translate.c
> +++ b/target/riscv/tcg/translate.c
> @@ -1324,7 +1324,6 @@ static void
> riscv_tr_init_disas_context(DisasContextBase *dcbase, CPUState *cs)
>      RISCVCPUClass *mcc = RISCV_CPU_GET_CLASS(cs);
>      RISCVCPU *cpu = RISCV_CPU(cs);
>      uint64_t tb_flags = ctx->base.tb->flags;
> -    uint64_t ext_tb_flags = ctx->base.tb->cs_base;
>  
>      ctx->pc_save = ctx->base.pc_first;
>      ctx->priv = FIELD_EX64(tb_flags, TB_FLAGS, PRIV);
> @@ -1344,7 +1343,7 @@ static void
> riscv_tr_init_disas_context(DisasContextBase *dcbase, CPUState *cs)
>      ctx->cfg_vta_all_1s = cpu->cfg.rvv_ta_all_1s;
>      ctx->vstart_eq_zero = FIELD_EX64(tb_flags, TB_FLAGS,
> VSTART_EQ_ZERO);
>      ctx->vl_eq_vlmax = FIELD_EX64(tb_flags, TB_FLAGS, VL_EQ_VLMAX);
> -    ctx->altfmt = FIELD_EX64(ext_tb_flags, EXT_TB_FLAGS, ALTFMT);
> +    ctx->altfmt = FIELD_EX64(tb_flags, TB_FLAGS, ALTFMT);
>      ctx->misa_mxl_max = mcc->def->misa_mxl_max;
>      ctx->xl = FIELD_EX64(tb_flags, TB_FLAGS, XL);
>      ctx->address_xl = FIELD_EX64(tb_flags, TB_FLAGS, AXL);
> @@ -1362,11 +1361,11 @@ static void
> riscv_tr_init_disas_context(DisasContextBase *dcbase, CPUState *cs)
>      ctx->bcfi_enabled = FIELD_EX64(tb_flags, TB_FLAGS,
> BCFI_ENABLED);
>      ctx->fcfi_lp_expected = FIELD_EX64(tb_flags, TB_FLAGS,
> FCFI_LP_EXPECTED);
>      ctx->fcfi_enabled = FIELD_EX64(tb_flags, TB_FLAGS,
> FCFI_ENABLED);
> -    ctx->sdext_step = FIELD_EX64(ext_tb_flags, EXT_TB_FLAGS,
> SDEXT_STEP);
> +    ctx->sdext_step = FIELD_EX64(tb_flags, TB_FLAGS, SDEXT_STEP);
>      ctx->zero = tcg_constant_tl(0);
>      ctx->virt_inst_excp = false;
>      ctx->decoders = cpu->decoders;
> -    ctx->mo_endianness = FIELD_EX64(ext_tb_flags, EXT_TB_FLAGS,
> BIG_ENDIAN)
> +    ctx->mo_endianness = FIELD_EX64(tb_flags, TB_FLAGS, BIG_ENDIAN)
>                           ? MO_BE : MO_LE;
>  }
>  

^ permalink raw reply	[flat|nested] 102+ messages in thread

* Re: [PATCH 07/24] target/hexagon: Use 64-bit TB flags
  2026-11-26 23:35 ` [PATCH 07/24] target/hexagon: " Philippe Mathieu-Daudé
  2026-11-27  4:56   ` Brian Cain
@ 2026-12-01  2:22   ` Brian Cain
  1 sibling, 0 replies; 102+ messages in thread
From: Brian Cain @ 2026-12-01  2:22 UTC (permalink / raw)
  To: Philippe Mathieu-Daudé, qemu-devel
  Cc: Richard Henderson, qemu-riscv, qemu-s390x, qemu-arm, qemu-ppc,
	Anton Johansson, Pierrick Bouvier


On 11/26/2026 5:35 PM, Philippe Mathieu-Daudé wrote:
> TranslationBlock::flags and TCGTBCPUState::flags are now
> 64-bit, use matching types for the values derived from them.
>
> Signed-off-by: Philippe Mathieu-Daudé <philmd@oss.qualcomm.com>
> ---
>   target/hexagon/cpu.c       | 16 ++++++++--------
>   target/hexagon/translate.c | 14 +++++++-------
>   2 files changed, 15 insertions(+), 15 deletions(-)

Reviewed-by: Brian Cain <brian.cain@oss.qualcomm.com>




^ permalink raw reply	[flat|nested] 102+ messages in thread

end of thread, other threads:[~2026-12-01  2:23 UTC | newest]

Thread overview: 102+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-11-26 23:35 [PATCH 00/24] accel/tcg: Widen TranslationBlock::flags to 64 bits Philippe Mathieu-Daudé
2026-11-26 23:35 ` [PATCH 01/24] target/arm: Widen CPUARMTBFlags::flags " Philippe Mathieu-Daudé
2026-11-27  9:58   ` Anton Johansson via
2026-11-27  9:58     ` Anton Johansson via qemu development
2026-11-27  9:58     ` Anton Johansson via
2026-11-26 23:35 ` [PATCH 02/24] accel/tcg: Update stale TranslationBlock::jmp_lock comment Philippe Mathieu-Daudé
2026-11-27  9:59   ` Anton Johansson via
2026-11-27  9:59     ` Anton Johansson via qemu development
2026-11-27  9:59     ` Anton Johansson via
2026-11-26 23:35 ` [PATCH 03/24] accel/tcg: Widen TranslationBlock::flags to 64 bits Philippe Mathieu-Daudé
2026-11-27 11:03   ` Anton Johansson via qemu development
2026-11-27 11:03     ` Anton Johansson via
2026-11-27 11:03     ` Anton Johansson via
2026-11-27 12:30     ` Philippe Mathieu-Daudé
2026-11-26 23:35 ` [PATCH 04/24] target/arm: Update TB flags split comment for 64-bit tb->flags Philippe Mathieu-Daudé
2026-11-27 11:09   ` Anton Johansson via
2026-11-27 11:09     ` Anton Johansson via qemu development
2026-11-27 11:09     ` Anton Johansson via
2026-11-26 23:35 ` [PATCH 05/24] target/alpha: Use 64-bit TB flags Philippe Mathieu-Daudé
2026-11-27 11:11   ` Anton Johansson via
2026-11-27 11:11     ` Anton Johansson via
2026-11-27 11:11     ` Anton Johansson via qemu development
2026-11-26 23:35 ` [PATCH 06/24] target/avr: " Philippe Mathieu-Daudé
2026-11-27 11:12   ` Anton Johansson via qemu development
2026-11-27 11:12     ` Anton Johansson via
2026-11-27 11:12     ` Anton Johansson via
2026-11-26 23:35 ` [PATCH 07/24] target/hexagon: " Philippe Mathieu-Daudé
2026-11-27  4:56   ` Brian Cain
2026-12-01  2:22   ` Brian Cain
2026-11-26 23:35 ` [PATCH 08/24] target/hppa: " Philippe Mathieu-Daudé
2026-11-27 11:13   ` Anton Johansson via qemu development
2026-11-27 11:13     ` Anton Johansson via
2026-11-27 11:13     ` Anton Johansson via
2026-11-26 23:35 ` [PATCH 09/24] target/i386: " Philippe Mathieu-Daudé
2026-11-27 11:14   ` Anton Johansson via qemu development
2026-11-27 11:14     ` Anton Johansson via
2026-11-27 11:14     ` Anton Johansson via
2026-11-26 23:35 ` [PATCH 10/24] target/loongarch: " Philippe Mathieu-Daudé
2026-11-27 11:16   ` Anton Johansson via qemu development
2026-11-27 11:16     ` Anton Johansson via
2026-11-27 11:16     ` Anton Johansson via
2026-11-30  1:03   ` Bibo Mao
2026-11-26 23:35 ` [PATCH 11/24] target/m68k: " Philippe Mathieu-Daudé
2026-11-27 11:16   ` Anton Johansson via qemu development
2026-11-27 11:16     ` Anton Johansson via
2026-11-27 11:16     ` Anton Johansson via
2026-11-26 23:35 ` [PATCH 12/24] target/microblaze: " Philippe Mathieu-Daudé
2026-11-27 11:17   ` Anton Johansson via
2026-11-27 11:17     ` Anton Johansson via
2026-11-27 11:17     ` Anton Johansson via qemu development
2026-11-26 23:35 ` [PATCH 13/24] target/mips: " Philippe Mathieu-Daudé
2026-11-27 11:19   ` Anton Johansson via qemu development
2026-11-27 11:19     ` Anton Johansson via
2026-11-27 11:19     ` Anton Johansson via
2026-11-26 23:35 ` [PATCH 14/24] target/or1k: " Philippe Mathieu-Daudé
2026-11-27 11:20   ` Anton Johansson via qemu development
2026-11-27 11:20     ` Anton Johansson via
2026-11-27 11:20     ` Anton Johansson via
2026-11-26 23:35 ` [PATCH 15/24] target/ppc: " Philippe Mathieu-Daudé
2026-11-27  7:57   ` Chinmay Rath
2026-11-27 12:09     ` Philippe Mathieu-Daudé
2026-11-26 23:35 ` [PATCH 16/24] target/riscv: " Philippe Mathieu-Daudé
2026-11-27 11:23   ` Anton Johansson via
2026-11-27 11:23     ` Anton Johansson via
2026-11-27 11:23     ` Anton Johansson via qemu development
2026-12-01  1:15   ` Alistair Francis
2026-12-01  1:16   ` Alistair Francis
2026-11-26 23:35 ` [PATCH 17/24] target/riscv: Partially revert use of tb->cs_base Philippe Mathieu-Daudé
2026-11-27 11:26   ` Anton Johansson via qemu development
2026-11-27 11:26     ` Anton Johansson via
2026-11-27 11:26     ` Anton Johansson via
2026-12-01  1:18   ` Alistair Francis
2026-11-26 23:35 ` [PATCH 18/24] target/rx: Use 64-bit TB flags Philippe Mathieu-Daudé
2026-11-27 11:27   ` Anton Johansson via qemu development
2026-11-27 11:27     ` Anton Johansson via
2026-11-27 11:27     ` Anton Johansson via
2026-11-28 13:42   ` yoshinori.sato
2026-11-26 23:35 ` [PATCH 19/24] target/s390x: " Philippe Mathieu-Daudé
2026-11-27 11:27   ` Anton Johansson via
2026-11-27 11:27     ` Anton Johansson via qemu development
2026-11-27 11:27     ` Anton Johansson via
2026-11-26 23:35 ` [PATCH 20/24] target/sh4: " Philippe Mathieu-Daudé
2026-11-27 11:29   ` Anton Johansson via
2026-11-27 11:29     ` Anton Johansson via qemu development
2026-11-27 11:29     ` Anton Johansson via
2026-11-28 13:42   ` yoshinori.sato
2026-11-26 23:35 ` [PATCH 21/24] target/sparc: " Philippe Mathieu-Daudé
2026-11-27 11:30   ` Anton Johansson via
2026-11-27 11:30     ` Anton Johansson via qemu development
2026-11-27 11:30     ` Anton Johansson via
2026-11-26 23:36 ` [PATCH 22/24] target/tricore: " Philippe Mathieu-Daudé
2026-11-27 11:31   ` Anton Johansson via
2026-11-27 11:31     ` Anton Johansson via qemu development
2026-11-27 11:31     ` Anton Johansson via
2026-11-26 23:36 ` [PATCH 23/24] target/xtensa: " Philippe Mathieu-Daudé
2026-11-27 11:32   ` Anton Johansson via qemu development
2026-11-27 11:32     ` Anton Johansson via
2026-11-27 11:32     ` Anton Johansson via
2026-11-26 23:36 ` [PATCH 24/24] accel/tcg: Update TranslationBlock::cs_base description Philippe Mathieu-Daudé
2026-11-27 11:34   ` Anton Johansson via
2026-11-27 11:34     ` Anton Johansson via qemu development
2026-11-27 11:34     ` Anton Johansson via

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.