diff options
author | Peter Maydell <peter.maydell@linaro.org> | 2022-03-15 20:43:05 +0000 |
---|---|---|
committer | Peter Maydell <peter.maydell@linaro.org> | 2022-03-18 11:08:59 +0000 |
commit | 8cc2246caa6c3eb56b250293aea212cf91c38490 (patch) | |
tree | 8d123889882c1c064dc55a08e17432c3ce68f2ae /target/arm/m_helper.c | |
parent | 299b4a3ecf1c7dcc57e55150d4cb234340749854 (diff) | |
download | qemu-8cc2246caa6c3eb56b250293aea212cf91c38490.zip qemu-8cc2246caa6c3eb56b250293aea212cf91c38490.tar.gz qemu-8cc2246caa6c3eb56b250293aea212cf91c38490.tar.bz2 |
target/arm: Log M-profile vector table accesses
Currently the CPU_LOG_INT logging misses some useful information
about loads from the vector table. Add logging where we load vector
table entries. This is particularly helpful for cases where the user
has accidentally not put a vector table in their image at all, which
can result in confusing guest crashes at startup.
Here's an example of the new logging for a case where
the vector table contains garbage:
Loaded reset SP 0x0 PC 0x0 from vector table
Loaded reset SP 0xd008f8df PC 0xf000bf00 from vector table
Taking exception 3 [Prefetch Abort] on CPU 0
...with CFSR.IACCVIOL
...BusFault with BFSR.STKERR
...taking pending nonsecure exception 3
...loading from element 3 of non-secure vector table at 0xc
...loaded new PC 0x20000558
----------------
IN:
0x20000558: 08000079 stmdaeq r0, {r0, r3, r4, r5, r6}
(The double reset logging is the result of our long-standing
"CPUs all get reset twice" weirdness; it looks a bit ugly
but it'll go away if we ever fix that :-))
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Reviewed-by: Alex Bennée <alex.bennee@linaro.org>
Message-id: 20220315204306.2797684-2-peter.maydell@linaro.org
Diffstat (limited to 'target/arm/m_helper.c')
-rw-r--r-- | target/arm/m_helper.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/target/arm/m_helper.c b/target/arm/m_helper.c index 648a3b3..3bd16c0 100644 --- a/target/arm/m_helper.c +++ b/target/arm/m_helper.c @@ -679,6 +679,10 @@ static bool arm_v7m_load_vector(ARMCPU *cpu, int exc, bool targets_secure, ARMMMUIdx mmu_idx; bool exc_secure; + qemu_log_mask(CPU_LOG_INT, + "...loading from element %d of %s vector table at 0x%x\n", + exc, targets_secure ? "secure" : "non-secure", addr); + mmu_idx = arm_v7m_mmu_idx_for_secstate_and_priv(env, targets_secure, true); /* @@ -719,6 +723,7 @@ static bool arm_v7m_load_vector(ARMCPU *cpu, int exc, bool targets_secure, goto load_fail; } *pvec = vector_entry; + qemu_log_mask(CPU_LOG_INT, "...loaded new PC 0x%x\n", *pvec); return true; load_fail: |