Skip to content

Commit 7472e2e

Browse files
committed
target/arm: Generate UNDEF for 32-bit Thumb2 insns
The refactoring of commit 296e5a0 has a nasty bug: it accidentally dropped the generation of code to raise the UNDEF exception when disas_thumb2_insn() returns nonzero. This means that 32-bit Thumb2 instruction patterns that ought to UNDEF just act like nops instead. This is likely to break any number of things, including the kernel's "disable the FPU and use the UNDEF exception to identify when to turn it back on again" trick. Signed-off-by: Peter Maydell <peter.maydell@linaro.org> Message-id: 1513006964-3371-1-git-send-email-peter.maydell@linaro.org Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
1 parent 2babfe0 commit 7472e2e

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

target/arm/translate.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12245,7 +12245,10 @@ static void thumb_tr_translate_insn(DisasContextBase *dcbase, CPUState *cpu)
1224512245
if (is_16bit) {
1224612246
disas_thumb_insn(dc, insn);
1224712247
} else {
12248-
disas_thumb2_insn(dc, insn);
12248+
if (disas_thumb2_insn(dc, insn)) {
12249+
gen_exception_insn(dc, 4, EXCP_UDEF, syn_uncategorized(),
12250+
default_exception_el(dc));
12251+
}
1224912252
}
1225012253

1225112254
/* Advance the Thumb condexec condition. */

0 commit comments

Comments
 (0)