Skip to content

Commit

Permalink
target/arm: Correct MPU trace handling of write vs execute
Browse files Browse the repository at this point in the history
Correct off-by-one bug in the PSMAv7 MPU tracing where it would print
a write access as "reading", an insn fetch as "writing", and a read
access as "execute".

Since we have an MMUAccessType enum now, we can make the code clearer
in the process by using that rather than the raw 0/1/2 values.

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Reviewed-by: Richard Henderson <rth@twiddle.net>
Message-id: 1500906792-18010-1-git-send-email-peter.maydell@linaro.org
  • Loading branch information
pm215 committed Jul 31, 2017
1 parent 25dd0e7 commit 709e440
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions target/arm/helper.c
Expand Up @@ -8558,8 +8558,8 @@ static bool get_phys_addr(CPUARMState *env, target_ulong address,
phys_ptr, prot, fsr);
qemu_log_mask(CPU_LOG_MMU, "PMSAv7 MPU lookup for %s at 0x%08" PRIx32
" mmu_idx %u -> %s (prot %c%c%c)\n",
access_type == 1 ? "reading" :
(access_type == 2 ? "writing" : "execute"),
access_type == MMU_DATA_LOAD ? "reading" :
(access_type == MMU_DATA_STORE ? "writing" : "execute"),
(uint32_t)address, mmu_idx,
ret ? "Miss" : "Hit",
*prot & PAGE_READ ? 'r' : '-',
Expand Down

0 comments on commit 709e440

Please sign in to comment.