[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PULL 12/19] target/mips: Don't update BadVAddr register in
From: |
Aleksandar Markovic |
Subject: |
[Qemu-devel] [PULL 12/19] target/mips: Don't update BadVAddr register in Debug Mode |
Date: |
Tue, 14 Aug 2018 20:16:54 +0200 |
From: Yongbok Kim <address@hidden>
BadVAddr should not be updated if (env->hflags & MIPS_HFLAG_DM) is
set.
Reviewed-by: Philippe Mathieu-Daudé <address@hidden>
Reviewed-by: Richard Henderson <address@hidden>
Signed-off-by: Yongbok Kim <address@hidden>
Signed-off-by: Aleksandar Markovic <address@hidden>
---
target/mips/helper.c | 4 +++-
target/mips/op_helper.c | 12 +++++++++---
2 files changed, 12 insertions(+), 4 deletions(-)
diff --git a/target/mips/helper.c b/target/mips/helper.c
index 8cf91ce..e215af9 100644
--- a/target/mips/helper.c
+++ b/target/mips/helper.c
@@ -502,7 +502,9 @@ static void raise_mmu_exception(CPUMIPSState *env,
target_ulong address,
break;
}
/* Raise exception */
- env->CP0_BadVAddr = address;
+ if (!(env->hflags & MIPS_HFLAG_DM)) {
+ env->CP0_BadVAddr = address;
+ }
env->CP0_Context = (env->CP0_Context & ~0x007fffff) |
((address >> 9) & 0x007ffff0);
env->CP0_EntryHi = (env->CP0_EntryHi & env->CP0_EntryHi_ASID_mask) |
diff --git a/target/mips/op_helper.c b/target/mips/op_helper.c
index 41d3634..0b2663b 100644
--- a/target/mips/op_helper.c
+++ b/target/mips/op_helper.c
@@ -271,7 +271,9 @@ static inline hwaddr do_translate_address(CPUMIPSState *env,
target_ulong helper_##name(CPUMIPSState *env, target_ulong arg, int mem_idx) \
{ \
if (arg & almask) { \
- env->CP0_BadVAddr = arg; \
+ if (!(env->hflags & MIPS_HFLAG_DM)) { \
+ env->CP0_BadVAddr = arg; \
+ } \
do_raise_exception(env, EXCP_AdEL, GETPC()); \
} \
env->lladdr = do_translate_address(env, arg, 0, GETPC()); \
@@ -291,7 +293,9 @@ target_ulong helper_##name(CPUMIPSState *env, target_ulong
arg1, \
target_long tmp; \
\
if (arg2 & almask) { \
- env->CP0_BadVAddr = arg2; \
+ if (!(env->hflags & MIPS_HFLAG_DM)) { \
+ env->CP0_BadVAddr = arg2; \
+ } \
do_raise_exception(env, EXCP_AdES, GETPC()); \
} \
if (do_translate_address(env, arg2, 1, GETPC()) == env->lladdr) { \
@@ -2437,7 +2441,9 @@ void mips_cpu_do_unaligned_access(CPUState *cs, vaddr
addr,
int error_code = 0;
int excp;
- env->CP0_BadVAddr = addr;
+ if (!(env->hflags & MIPS_HFLAG_DM)) {
+ env->CP0_BadVAddr = addr;
+ }
if (access_type == MMU_DATA_STORE) {
excp = EXCP_AdES;
--
2.7.4
- [Qemu-devel] [PULL 09/19] target/mips: Add support for availability control via bit MT, (continued)
- [Qemu-devel] [PULL 09/19] target/mips: Add support for availability control via bit MT, Aleksandar Markovic, 2018/08/14
- [Qemu-devel] [PULL 08/19] target/mips: Add support for availability control via bit XNP, Aleksandar Markovic, 2018/08/14
- [Qemu-devel] [PULL 15/19] elf: Remove duplicate preprocessor constant definition, Aleksandar Markovic, 2018/08/14
- [Qemu-devel] [PULL 18/19] linux-user: Add preprocessor availability control to some syscalls, Aleksandar Markovic, 2018/08/14
- [Qemu-devel] [PULL 01/19] MAINTAINERS: Update target/mips maintainer's email addresses, Aleksandar Markovic, 2018/08/14
- [Qemu-devel] [PULL 06/19] target/mips: Update some CP0 registers bit definitions, Aleksandar Markovic, 2018/08/14
- [Qemu-devel] [PULL 10/19] target/mips: Fix MT ASE instructions' availability control, Aleksandar Markovic, 2018/08/14
- [Qemu-devel] [PULL 07/19] target/mips: Add CP0 BadInstrX register, Aleksandar Markovic, 2018/08/14
- [Qemu-devel] [PULL 14/19] target/mips: Add gen_op_addr_addi(), Aleksandar Markovic, 2018/08/14
- [Qemu-devel] [PULL 11/19] target/mips: Implement CP0 Config1.WR bit functionality, Aleksandar Markovic, 2018/08/14
- [Qemu-devel] [PULL 12/19] target/mips: Don't update BadVAddr register in Debug Mode,
Aleksandar Markovic <=
- [Qemu-devel] [PULL 16/19] elf: Add ELF flags for MIPS machine variants, Aleksandar Markovic, 2018/08/14
- [Qemu-devel] [PULL 17/19] linux-user: Update MIPS syscall numbers up to kernel 4.18 headers, Aleksandar Markovic, 2018/08/14
- [Qemu-devel] [PULL 19/19] qemu-doc: Amend MIPS-related items, Aleksandar Markovic, 2018/08/14
- Re: [Qemu-devel] [PULL 00/19] MIPS queue for QEMU upstream, August 14, 2018, Peter Maydell, 2018/08/15