All of lore.kernel.org
 help / color / mirror / Atom feed
From: Peter Maydell <peter.maydell@linaro.org>
To: qemu-devel@nongnu.org
Subject: [PULL 17/32] target/arm: Log CPU index in 'Taking exception' log
Date: Fri, 28 Jan 2022 15:29:54 +0000	[thread overview]
Message-ID: <20220128153009.2467560-18-peter.maydell@linaro.org> (raw)
In-Reply-To: <20220128153009.2467560-1-peter.maydell@linaro.org>

In an SMP system it can be unclear which CPU is taking an exception;
add the CPU index (which is the same value used in the TCG 'Trace
%d:' logging) to the "Taking exception" log line to clarify it.

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>
Message-id: 20220122182444.724087-2-peter.maydell@linaro.org
---
 target/arm/internals.h | 2 +-
 target/arm/helper.c    | 9 ++++++---
 target/arm/m_helper.c  | 2 +-
 3 files changed, 8 insertions(+), 5 deletions(-)

diff --git a/target/arm/internals.h b/target/arm/internals.h
index 89f7610ebc5..3f05748ea47 100644
--- a/target/arm/internals.h
+++ b/target/arm/internals.h
@@ -1130,7 +1130,7 @@ bool get_phys_addr(CPUARMState *env, target_ulong address,
                    ARMMMUFaultInfo *fi, ARMCacheAttrs *cacheattrs)
     __attribute__((nonnull));
 
-void arm_log_exception(int idx);
+void arm_log_exception(CPUState *cs);
 
 #endif /* !CONFIG_USER_ONLY */
 
diff --git a/target/arm/helper.c b/target/arm/helper.c
index cfca0f5ba6d..4df12394021 100644
--- a/target/arm/helper.c
+++ b/target/arm/helper.c
@@ -9317,8 +9317,10 @@ uint32_t arm_phys_excp_target_el(CPUState *cs, uint32_t excp_idx,
     return target_el;
 }
 
-void arm_log_exception(int idx)
+void arm_log_exception(CPUState *cs)
 {
+    int idx = cs->exception_index;
+
     if (qemu_loglevel_mask(CPU_LOG_INT)) {
         const char *exc = NULL;
         static const char * const excnames[] = {
@@ -9352,7 +9354,8 @@ void arm_log_exception(int idx)
         if (!exc) {
             exc = "unknown";
         }
-        qemu_log_mask(CPU_LOG_INT, "Taking exception %d [%s]\n", idx, exc);
+        qemu_log_mask(CPU_LOG_INT, "Taking exception %d [%s] on CPU %d\n",
+                      idx, exc, cs->cpu_index);
     }
 }
 
@@ -10185,7 +10188,7 @@ void arm_cpu_do_interrupt(CPUState *cs)
 
     assert(!arm_feature(env, ARM_FEATURE_M));
 
-    arm_log_exception(cs->exception_index);
+    arm_log_exception(cs);
     qemu_log_mask(CPU_LOG_INT, "...from EL%d to EL%d\n", arm_current_el(env),
                   new_el);
     if (qemu_loglevel_mask(CPU_LOG_INT)
diff --git a/target/arm/m_helper.c b/target/arm/m_helper.c
index 2c9922dc292..b11e927df1d 100644
--- a/target/arm/m_helper.c
+++ b/target/arm/m_helper.c
@@ -2206,7 +2206,7 @@ void arm_v7m_cpu_do_interrupt(CPUState *cs)
     uint32_t lr;
     bool ignore_stackfaults;
 
-    arm_log_exception(cs->exception_index);
+    arm_log_exception(cs);
 
     /*
      * For exceptions we just mark as pending on the NVIC, and let that
-- 
2.25.1



  parent reply	other threads:[~2022-01-28 15:45 UTC|newest]

Thread overview: 34+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-01-28 15:29 [PULL 00/32] target-arm queue Peter Maydell
2022-01-28 15:29 ` [PULL 01/32] Update copyright dates to 2022 Peter Maydell
2022-01-28 15:29 ` [PULL 02/32] hw/armv7m: Fix broken VMStateDescription Peter Maydell
2022-01-28 15:29 ` [PULL 03/32] hw/char/exynos4210_uart: Fix crash on trying to load VM state Peter Maydell
2022-01-28 15:29 ` [PULL 04/32] rtc: Move RTC function prototypes to their own header Peter Maydell
2022-01-28 15:29 ` [PULL 05/32] hw/misc: Add a model of Versal's PMC SLCR Peter Maydell
2022-01-28 15:29 ` [PULL 06/32] hw/arm/xlnx-versal: 'Or' the interrupts from the BBRAM and RTC models Peter Maydell
2022-01-28 15:29 ` [PULL 07/32] hw/arm/xlnx-versal: Connect Versal's PMC SLCR Peter Maydell
2022-01-28 15:29 ` [PULL 08/32] include/hw/dma/xlnx_csu_dma: Add in missing includes in the header Peter Maydell
2022-01-28 15:29 ` [PULL 09/32] hw/dma/xlnx_csu_dma: Support starting a read transfer through a class method Peter Maydell
2022-01-28 15:29 ` [PULL 10/32] hw/ssi: Add a model of Xilinx Versal's OSPI flash memory controller Peter Maydell
2022-01-28 15:29 ` [PULL 11/32] hw/arm/xlnx-versal: Connect the OSPI flash memory controller model Peter Maydell
2022-01-28 15:29 ` [PULL 12/32] hw/block/m25p80: Add support for Micron Xccela flash mt35xu01g Peter Maydell
2022-01-28 15:29 ` [PULL 13/32] hw/arm/xlnx-versal-virt: Connect mt35xu01g flashes to the OSPI Peter Maydell
2022-01-28 15:29 ` [PULL 14/32] MAINTAINERS: Add an entry for Xilinx Versal OSPI Peter Maydell
2022-01-28 15:29 ` [PULL 15/32] MAINTAINERS: Remove myself (for raspi) Peter Maydell
2022-01-28 15:29 ` [PULL 16/32] scripts: Explain the difference between linux-headers and standard-headers Peter Maydell
2022-01-28 15:29 ` Peter Maydell [this message]
2022-01-28 15:29 ` [PULL 18/32] hw/intc/arm_gicv3_its: Add tracepoints Peter Maydell
2022-01-28 15:29 ` [PULL 19/32] hw/intc/arm_gicv3: Initialise dma_as in GIC, not ITS Peter Maydell
2022-01-28 15:29 ` [PULL 20/32] hw/intc/arm_gicv3_its: Don't clear GITS_CREADR when GITS_CTLR.ENABLED is set Peter Maydell
2022-01-28 15:29 ` [PULL 21/32] hw/intc/arm_gicv3_its: Don't clear GITS_CWRITER on writes to GITS_CBASER Peter Maydell
2022-01-28 15:29 ` [PULL 22/32] hw/intc/arm_gicv3: Honour GICD_CTLR.EnableGrp1NS for LPIs Peter Maydell
2022-01-28 15:30 ` [PULL 23/32] hw/intc/arm_gicv3_its: Sort ITS command list into numeric order Peter Maydell
2022-01-28 15:30 ` [PULL 24/32] hw/intc/arm_gicv3_redist: Remove unnecessary zero checks Peter Maydell
2022-01-28 15:30 ` [PULL 25/32] hw/intc/arm_gicv3: Set GICR_CTLR.CES if LPIs are supported Peter Maydell
2022-01-28 15:30 ` [PULL 26/32] hw/intc/arm_gicv3_its: Provide read accessor for translation_ops Peter Maydell
2022-01-28 15:30 ` [PULL 27/32] hw/intc/arm_gicv3_its: Make GITS_BASER<n> RAZ/WI for unimplemented registers Peter Maydell
2022-01-28 15:30 ` [PULL 28/32] hw/intc/arm_gicv3_its: Check table bounds against correct limit Peter Maydell
2022-01-28 15:30 ` [PULL 29/32] hw/intc/arm_gicv3_its: Implement MOVALL Peter Maydell
2022-01-28 15:30 ` [PULL 30/32] hw/intc/arm_gicv3_its: Implement MOVI Peter Maydell
2022-01-28 15:30 ` [PULL 31/32] hw/arm: ast2600: Fix address mapping of second SPI controller Peter Maydell
2022-01-28 15:30 ` [PULL 32/32] target/arm: Use correct entrypoint for SVC taken from Hyp to Hyp Peter Maydell
2022-01-29 15:55 ` [PULL 00/32] target-arm queue Peter Maydell

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20220128153009.2467560-18-peter.maydell@linaro.org \
    --to=peter.maydell@linaro.org \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.