summaryrefslogtreecommitdiff
path: root/target-microblaze
diff options
context:
space:
mode:
authorEdgar E. Iglesias <edgar.iglesias@gmail.com>2009-09-04 10:38:59 +0200
committerEdgar E. Iglesias <edgar.iglesias@gmail.com>2009-09-04 10:38:59 +0200
commit59b81ab81cd4ac137e8e2684dcd7b4cf363fbdaf (patch)
tree7a07f9a85ec209eaa0f1e556ee294d65cf2fbbdf /target-microblaze
parent0aeb8bbc8aae034b120873a905eba13a337bf7d4 (diff)
downloadqemu-59b81ab81cd4ac137e8e2684dcd7b4cf363fbdaf.tar.gz
qemu-59b81ab81cd4ac137e8e2684dcd7b4cf363fbdaf.tar.bz2
qemu-59b81ab81cd4ac137e8e2684dcd7b4cf363fbdaf.zip
microblaze: Trap on illegal load/store sizes.
Signed-off-by: Edgar E. Iglesias <edgar.iglesias@gmail.com>
Diffstat (limited to 'target-microblaze')
-rw-r--r--target-microblaze/translate.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/target-microblaze/translate.c b/target-microblaze/translate.c
index b180d24b0e..bb37f04edb 100644
--- a/target-microblaze/translate.c
+++ b/target-microblaze/translate.c
@@ -803,6 +803,12 @@ static void dec_load(DisasContext *dc)
unsigned int size;
size = 1 << (dc->opcode & 3);
+ if (size > 4 && (dc->tb_flags & MSR_EE_FLAG)
+ && !(dc->env->pvr.regs[2] & PVR2_ILL_OPCODE_EXC_MASK)) {
+ tcg_gen_movi_tl(cpu_SR[SR_ESR], ESR_EC_ILLEGAL_OP);
+ t_gen_raise_exception(dc, EXCP_HW_EXCP);
+ return;
+ }
LOG_DIS("l %x %d\n", dc->opcode, size);
t_sync_flags(dc);
@@ -849,6 +855,13 @@ static void dec_store(DisasContext *dc)
size = 1 << (dc->opcode & 3);
+ if (size > 4 && (dc->tb_flags & MSR_EE_FLAG)
+ && !(dc->env->pvr.regs[2] & PVR2_ILL_OPCODE_EXC_MASK)) {
+ tcg_gen_movi_tl(cpu_SR[SR_ESR], ESR_EC_ILLEGAL_OP);
+ t_gen_raise_exception(dc, EXCP_HW_EXCP);
+ return;
+ }
+
LOG_DIS("s%d%s\n", size, dc->type_b ? "i" : "");
t_sync_flags(dc);
/* If we get a fault on a dslot, the jmpstate better be in sync. */