From 4dc69f4b26fc6772a6a4417caf943a864f2e923e Mon Sep 17 00:00:00 2001 From: Peter Maydell Date: Sun, 4 Mar 2018 01:13:13 -0500 Subject: [PATCH] target/arm: Correct MPU trace handling of write vs execute 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. Backports commit 709e4407add7acacc593cb6cdac026558c9a8fb6 from qemu --- qemu/target/arm/helper.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/qemu/target/arm/helper.c b/qemu/target/arm/helper.c index 3e5052f5..834067d4 100644 --- a/qemu/target/arm/helper.c +++ b/qemu/target/arm/helper.c @@ -7826,8 +7826,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' : '-',