]> xenbits.xensource.com Git - people/pauldu/qemu.git/commitdiff
target/sh4: Mask restore of env->flags from tb->flags
authorGuenter Roeck <linux@roeck-us.net>
Mon, 12 Dec 2022 15:03:17 +0000 (09:03 -0600)
committerRichard Henderson <richard.henderson@linaro.org>
Sun, 18 Dec 2022 17:36:07 +0000 (09:36 -0800)
The values in env->flags are a subset of tb->flags.
Restore only the bits that belong.

Cc: qemu-stable@nongnu.org
Fixes: ab419fd8a035 ("target/sh4: Fix TB_FLAG_UNALIGN")
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Message-ID: <20221212011345.GA2235238@roeck-us.net>
[rth: Reduce to only the the superh_cpu_synchronize_from_tb change]
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
target/sh4/cpu.c

index 951eb6b9c8de0b514624f53f935d3107a4734a80..f0934b20fa564ea25452ec3ad9cc0cd3cbee1b3a 100644 (file)
@@ -47,7 +47,7 @@ static void superh_cpu_synchronize_from_tb(CPUState *cs,
     SuperHCPU *cpu = SUPERH_CPU(cs);
 
     cpu->env.pc = tb_pc(tb);
-    cpu->env.flags = tb->flags;
+    cpu->env.flags = tb->flags & TB_FLAG_ENVFLAGS_MASK;
 }
 
 static void superh_restore_state_to_opc(CPUState *cs,