]> Git Repo - qemu.git/commitdiff
target-xtensa: raise an exception for invalid and reserved opcodes
authorMax Filippov <[email protected]>
Tue, 25 Oct 2011 14:24:09 +0000 (18:24 +0400)
committerMax Filippov <[email protected]>
Wed, 2 Nov 2011 01:05:52 +0000 (05:05 +0400)
This includes opcodes from disabled features and those marked reserved in the ISA.
Also end TB on opcodes that definitely generate an exception: illegal
instructions, syscall and privileged instructions.

Signed-off-by: Max Filippov <[email protected]>
target-xtensa/translate.c

index b724d466d6c96df65962ddc712df26c84c6ba42f..c81450d1a5393a972af622cf8a304d05e91d883f 100644 (file)
@@ -266,6 +266,10 @@ static void gen_exception_cause(DisasContext *dc, uint32_t cause)
     gen_helper_exception_cause(tpc, tcause);
     tcg_temp_free(tpc);
     tcg_temp_free(tcause);
+    if (cause == ILLEGAL_INSTRUCTION_CAUSE ||
+            cause == SYSCALL_CAUSE) {
+        dc->is_jmp = DISAS_UPDATE;
+    }
 }
 
 static void gen_exception_cause_vaddr(DisasContext *dc, uint32_t cause,
@@ -283,6 +287,7 @@ static void gen_check_privilege(DisasContext *dc)
 {
     if (dc->cring) {
         gen_exception_cause(dc, PRIVILEGED_CAUSE);
+        dc->is_jmp = DISAS_UPDATE;
     }
 }
 
@@ -2378,7 +2383,7 @@ static void disas_xtensa_insn(DisasContext *dc)
 
 invalid_opcode:
     qemu_log("INVALID(pc = %08x)\n", dc->pc);
-    dc->pc = dc->next_pc;
+    gen_exception_cause(dc, ILLEGAL_INSTRUCTION_CAUSE);
 #undef HAS_OPTION
 }
 
This page took 0.034087 seconds and 4 git commands to generate.