[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH 3/7] target-xtensa: raise an exception for invalid a
From: |
Max Filippov |
Subject: |
[Qemu-devel] [PATCH 3/7] target-xtensa: raise an exception for invalid and reserved opcodes |
Date: |
Tue, 1 Nov 2011 02:17:30 +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 <address@hidden>
---
target-xtensa/translate.c | 7 ++++++-
1 files changed, 6 insertions(+), 1 deletions(-)
diff --git a/target-xtensa/translate.c b/target-xtensa/translate.c
index b724d46..c81450d 100644
--- a/target-xtensa/translate.c
+++ b/target-xtensa/translate.c
@@ -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
}
--
1.7.6.4
- [Qemu-devel] [PULL 0/7] target-xtensa patches for 1.0, Max Filippov, 2011/10/31
- [Qemu-devel] [PATCH 2/7] target-xtensa: handle cache options in the overlay tool, Max Filippov, 2011/10/31
- [Qemu-devel] [PATCH 1/7] target-xtensa: mask out undefined bits of WINDOWBASE SR, Max Filippov, 2011/10/31
- [Qemu-devel] [PATCH 1/3] xtensa_lx60: add FLASH support, Max Filippov, 2011/10/31
- [Qemu-devel] [PATCH 2/3] xtensa_lx60: pass kernel arguments from -append, Max Filippov, 2011/10/31
- [Qemu-devel] [PATCH 3/3] xtensa_lx60: fix build date code and change memory region names, Max Filippov, 2011/10/31
- [Qemu-devel] [PATCH 4/7] opencores_eth: fix RX path: FCS, padding and TL, Max Filippov, 2011/10/31
- [Qemu-devel] [PATCH 3/7] target-xtensa: raise an exception for invalid and reserved opcodes,
Max Filippov <=
- [Qemu-devel] [PATCH 6/7] xtensa_lx60: pass kernel arguments from -append, Max Filippov, 2011/10/31
- [Qemu-devel] [PATCH 7/7] xtensa_lx60: fix build date code and change memory region names, Max Filippov, 2011/10/31
- [Qemu-devel] [PATCH 5/7] xtensa_lx60: add FLASH support, Max Filippov, 2011/10/31
- Re: [Qemu-devel] [PULL 0/7] target-xtensa patches for 1.0, Max Filippov, 2011/10/31