target/m68k/cpu.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
TB_FLAGS_TRACE and TB_FLAGS_TRACE_BIT are swapped.
Fix to avoid m68k_get_tb_cpu_state() set an invalid bit.
Fixes: 5e50c6c72bf8 ("target/m68k: implement m68k trace mode")
Signed-off-by: Philippe Mathieu-Daudé <philmd@oss.qualcomm.com>
---
target/m68k/cpu.h | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/target/m68k/cpu.h b/target/m68k/cpu.h
index 781c98f78400..5adca8ed49f7 100644
--- a/target/m68k/cpu.h
+++ b/target/m68k/cpu.h
@@ -606,8 +606,8 @@ void m68k_cpu_transaction_failed(CPUState *cs, hwaddr physaddr, vaddr addr,
#define TB_FLAGS_SFC_S (1 << TB_FLAGS_SFC_S_BIT)
#define TB_FLAGS_DFC_S_BIT 15
#define TB_FLAGS_DFC_S (1 << TB_FLAGS_DFC_S_BIT)
-#define TB_FLAGS_TRACE 16
-#define TB_FLAGS_TRACE_BIT (1 << TB_FLAGS_TRACE)
+#define TB_FLAGS_TRACE_BIT 16
+#define TB_FLAGS_TRACE (1 << TB_FLAGS_TRACE_BIT)
void dump_mmu(CPUM68KState *env);
--
2.55.0
On 17/11/2026 08:07, Philippe Mathieu-Daudé wrote:
> TB_FLAGS_TRACE and TB_FLAGS_TRACE_BIT are swapped.
> Fix to avoid m68k_get_tb_cpu_state() set an invalid bit.
>
> Fixes: 5e50c6c72bf8 ("target/m68k: implement m68k trace mode")
> Signed-off-by: Philippe Mathieu-Daudé <philmd@oss.qualcomm.com>
> ---
> target/m68k/cpu.h | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/target/m68k/cpu.h b/target/m68k/cpu.h
> index 781c98f78400..5adca8ed49f7 100644
> --- a/target/m68k/cpu.h
> +++ b/target/m68k/cpu.h
> @@ -606,8 +606,8 @@ void m68k_cpu_transaction_failed(CPUState *cs, hwaddr physaddr, vaddr addr,
> #define TB_FLAGS_SFC_S (1 << TB_FLAGS_SFC_S_BIT)
> #define TB_FLAGS_DFC_S_BIT 15
> #define TB_FLAGS_DFC_S (1 << TB_FLAGS_DFC_S_BIT)
> -#define TB_FLAGS_TRACE 16
> -#define TB_FLAGS_TRACE_BIT (1 << TB_FLAGS_TRACE)
> +#define TB_FLAGS_TRACE_BIT 16
> +#define TB_FLAGS_TRACE (1 << TB_FLAGS_TRACE_BIT)
>
> void dump_mmu(CPUM68KState *env);
*facepalm*. I must have introduced this bug during submission for upstream as I
definitely used it during development for debugging a NetBSD issue. Thanks for
spotting this Phil!
Reviewed-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
ATB,
Mark.
On 11/17/26 00:07, Philippe Mathieu-Daudé wrote:
> TB_FLAGS_TRACE and TB_FLAGS_TRACE_BIT are swapped.
> Fix to avoid m68k_get_tb_cpu_state() set an invalid bit.
>
> Fixes: 5e50c6c72bf8 ("target/m68k: implement m68k trace mode")
> Signed-off-by: Philippe Mathieu-Daudé <philmd@oss.qualcomm.com>
> ---
> target/m68k/cpu.h | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/target/m68k/cpu.h b/target/m68k/cpu.h
> index 781c98f78400..5adca8ed49f7 100644
> --- a/target/m68k/cpu.h
> +++ b/target/m68k/cpu.h
> @@ -606,8 +606,8 @@ void m68k_cpu_transaction_failed(CPUState *cs, hwaddr physaddr, vaddr addr,
> #define TB_FLAGS_SFC_S (1 << TB_FLAGS_SFC_S_BIT)
> #define TB_FLAGS_DFC_S_BIT 15
> #define TB_FLAGS_DFC_S (1 << TB_FLAGS_DFC_S_BIT)
> -#define TB_FLAGS_TRACE 16
> -#define TB_FLAGS_TRACE_BIT (1 << TB_FLAGS_TRACE)
> +#define TB_FLAGS_TRACE_BIT 16
> +#define TB_FLAGS_TRACE (1 << TB_FLAGS_TRACE_BIT)
>
> void dump_mmu(CPUM68KState *env);
>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
r~
© 2016 - 2026 Red Hat, Inc.