]> git.ipfire.org Git - thirdparty/qemu.git/commitdiff
target/mips: Do not abort on invalid instruction
authorPhilippe Mathieu-Daudé <f4bug@amsat.org>
Sat, 22 May 2021 18:16:15 +0000 (20:16 +0200)
committerPhilippe Mathieu-Daudé <f4bug@amsat.org>
Thu, 24 Jun 2021 14:48:07 +0000 (16:48 +0200)
On real hardware an invalid instruction doesn't halt the world,
but usually triggers a RESERVED INSTRUCTION exception.
TCG guest code shouldn't abort QEMU anyway.

Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Message-Id: <20210617174323.2900831-2-f4bug@amsat.org>

target/mips/tcg/translate.c

index 3fd0c48d77208557a85cf149478ecc1dac4ecfe1..4b7229a868ae9db48ff21aa76d360abf552d4507 100644 (file)
@@ -12151,8 +12151,8 @@ static void gen_branch(DisasContext *ctx, int insn_bytes)
             tcg_gen_lookup_and_goto_ptr();
             break;
         default:
-            fprintf(stderr, "unknown branch 0x%x\n", proc_hflags);
-            abort();
+            LOG_DISAS("unknown branch 0x%x\n", proc_hflags);
+            gen_reserved_instruction(ctx);
         }
     }
 }