[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH v2 26/33] target/mips: Fix ERET/ERETNC behavior rela
From: |
Aleksandar Markovic |
Subject: |
[Qemu-devel] [PATCH v2 26/33] target/mips: Fix ERET/ERETNC behavior related to ADEL exception |
Date: |
Mon, 9 Jul 2018 22:50:24 +0200 |
From: Yongbok Kim <address@hidden>
Fix ERET/ERETNC so that ADEL exception can be raised.
Signed-off-by: Yongbok Kim <address@hidden>
Signed-off-by: Aleksandar Markovic <address@hidden>
Signed-off-by: Stefan Markovic <address@hidden>
---
target/mips/op_helper.c | 11 ++++++++++-
1 file changed, 10 insertions(+), 1 deletion(-)
diff --git a/target/mips/op_helper.c b/target/mips/op_helper.c
index c55a1e6..e6749c5 100644
--- a/target/mips/op_helper.c
+++ b/target/mips/op_helper.c
@@ -2430,6 +2430,13 @@ static void set_pc(CPUMIPSState *env, target_ulong
error_pc)
env->active_tc.PC = error_pc & ~(target_ulong)1;
if (env->insn_flags & ISA_NANOMIPS32) {
/* Don't clear MIPS_HFLAG_M16 */
+ if (error_pc & 1) {
+ if (!(env->hflags & MIPS_HFLAG_DM)) {
+ env->CP0_BadVAddr = error_pc;
+ }
+ env->active_tc.PC = error_pc;
+ do_raise_exception(env, EXCP_AdEL, 0);
+ }
return;
}
if (error_pc & 1) {
@@ -2467,10 +2474,12 @@ void helper_eretnc(CPUMIPSState *env)
void helper_deret(CPUMIPSState *env)
{
debug_pre_eret(env);
- set_pc(env, env->CP0_DEPC);
env->hflags &= ~MIPS_HFLAG_DM;
compute_hflags(env);
+
+ set_pc(env, env->CP0_DEPC);
+
debug_post_eret(env);
}
#endif /* !CONFIG_USER_ONLY */
--
2.7.4
- [Qemu-devel] [PATCH v2 19/33] target/mips: Implement emualtion of nanoMIPS LLWP/SCWP pair, (continued)
- [Qemu-devel] [PATCH v2 19/33] target/mips: Implement emualtion of nanoMIPS LLWP/SCWP pair, Aleksandar Markovic, 2018/07/09
- [Qemu-devel] [PATCH v2 20/33] target/mips: Add updating BadInstr and BadInstrP registers for nanoMIPS, Aleksandar Markovic, 2018/07/09
- [Qemu-devel] [PATCH v2 21/33] target/mips: Add updating CP0 BadInstrX register for nanoMIPs only, Aleksandar Markovic, 2018/07/09
- [Qemu-devel] [PATCH v2 22/33] target/mips: Adjust behavior of Config3's ISAOnExc bit for nanoMIPS, Aleksandar Markovic, 2018/07/09
- [Qemu-devel] [PATCH v2 23/33] target/mips: Adjust exception_resume_pc() for nanoMIPS, Aleksandar Markovic, 2018/07/09
- [Qemu-devel] [PATCH v2 24/33] target/mips: Adjust set_hflags_for_handler() for nanoMIPS, Aleksandar Markovic, 2018/07/09
- [Qemu-devel] [PATCH v2 25/33] target/mips: Adjust set_pc() for nanoMIPS, Aleksandar Markovic, 2018/07/09
- [Qemu-devel] [PATCH v2 26/33] target/mips: Fix ERET/ERETNC behavior related to ADEL exception,
Aleksandar Markovic <=
- [Qemu-devel] [PATCH v2 27/33] target/mips: Add ELF flags for MIPS machine variants, Aleksandar Markovic, 2018/07/09
- [Qemu-devel] [PATCH v2 28/33] mips_malta: Add basic nanoMIPS boot code for MIPS' Malta, Aleksandar Markovic, 2018/07/09
- [Qemu-devel] [PATCH v2 29/33] mips_malta: Setup GT64120 BARs in nanoMIPS bootloader, Aleksandar Markovic, 2018/07/09
- [Qemu-devel] [PATCH v2 30/33] mips_malta: Fix semihosting argument passing for nanoMIPS bare metal, Aleksandar Markovic, 2018/07/09
- [Qemu-devel] [PATCH v2 31/33] gdbstub: Disable handling of nanoMIPS ISA bit in the MIPS gdbstub, Aleksandar Markovic, 2018/07/09