From patchwork Fri Jan 28 15:29:54 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Peter Maydell X-Patchwork-Id: 537590 Delivered-To: patch@linaro.org Received: by 2002:ac0:f7d2:0:0:0:0:0 with SMTP id i18csp731902imr; Fri, 28 Jan 2022 07:43:52 -0800 (PST) X-Google-Smtp-Source: ABdhPJxHHB/b4RD0n2D257w+laalnWgqecmwvjAtVywQYP78B7egXVhXw/FwajV+J7S+l0wBMEub X-Received: by 2002:a25:c983:: with SMTP id z125mr13660865ybf.132.1643384632572; Fri, 28 Jan 2022 07:43:52 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1643384632; cv=none; d=google.com; s=arc-20160816; b=zbe3bqoT+MtdHH3kZ+nwE7zMWwhNI6kYk9OCTSXz1nzulMPoIA5lDn339SqN0Ae77E tl8Lgn3V3xkx/dhQT8v9S3VLaHZj46hNWG3pBbGomPuipO2Naptlj1cpaYQK++T3iq3A WKvMKtKKHn+8dvF95WwVkRWUus9RRjFJXQNGdpO3dpXMplG47M/poZo/AQByEtLDWKKN k9JvevFhR30BL7MLmsbPgy7FU3ye9BC5oxbDxtXNrYjbm41PPTa3m3tvbStD8tOXoddU VSF1G4JkLmy7xSVpdPRTpJgjG+snIoOQGCfHpiN85h+nL9KPRucHFQGGXVM1HgR0z7u8 JTeg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:to:from :dkim-signature; bh=ZFj0BsQuhPdpN6HiulkG32ZQk/456mTtdXfhKwX2aq8=; b=E28/zvfruXhTA2DQ3cmbZbTQLJ4dIbOMhLJBvnaosBdBpnBj0LYRZe5VnjtApwyI/s piIqaZfGs4PzKbbKvK1Zlis46yEqvnWkMqWkd+KR7MLa+yCZrUzik9V9H2NVY5Xf9GSZ D9HCv/XiyxPSJCeYuFyKgik0r9YGYblkfDRN0xgiuP9jc1cL3qZk2xxTQCr5UiNz+nND N4k9TDPtxjHwmJksG1jGBC+lRgNTWPqkehuLguX5sph8Xwme1t7XJ0cyBAKi+XAuPRV0 ToC9JhzJ3l537bp1Z8Mzy8ZxOAk3kJhJkeWDiyNOM2Isz7qAcL2Fck30qpJM6BUBFAR+ Ts/A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=B20p+T1x; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id k8si13607141ybt.465.2022.01.28.07.43.52 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 28 Jan 2022 07:43:52 -0800 (PST) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=B20p+T1x; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1]:45546 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nDTPj-0003GR-Sq for patch@linaro.org; Fri, 28 Jan 2022 10:43:52 -0500 Received: from eggs.gnu.org ([209.51.188.92]:57734) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nDTDB-0002Ax-CI for qemu-devel@nongnu.org; Fri, 28 Jan 2022 10:30:58 -0500 Received: from [2a00:1450:4864:20::32d] (port=54013 helo=mail-wm1-x32d.google.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1nDTD0-0006Q3-2t for qemu-devel@nongnu.org; Fri, 28 Jan 2022 10:30:47 -0500 Received: by mail-wm1-x32d.google.com with SMTP id n8so4669337wmk.3 for ; Fri, 28 Jan 2022 07:30:32 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:subject:date:message-id:in-reply-to:references:mime-version :content-transfer-encoding; bh=ZFj0BsQuhPdpN6HiulkG32ZQk/456mTtdXfhKwX2aq8=; b=B20p+T1xqbTWihSzJeB7Bbqn7C+vQAF76SyqdKqV0BBZQ/ZZN7B1+BsYeOGm55USR8 27wLa/ZM3LRaDdSQqIUvjVgMXCWQgs5ekSkNeC3wU2tEcODRVRqjhLlq1dXOuz+VFlqu 4IFjLh/hseeMvioPxC9Vzoo+0tuvApFqUO3EO7XCRHmYUjGGzBJ64cFAgmXi+24Mz3Ct IWJwWQn894P0TNY3Vt3ZbIMTZSBCZR7oKgSqdNPDX/580dfgKgKDWnAoga70I0tNMzb0 sQZX5MP1OvvEhsyjVVZmM/i0KeJTHZ3u1/lGAOZN9Qx+tQJAdZdgMFZO/Q+d5Z8phtPr 8hFQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=ZFj0BsQuhPdpN6HiulkG32ZQk/456mTtdXfhKwX2aq8=; b=SlN5ludbMu/aDKzbm7o+GVwiQ9Kkx+hvvE8wJf6aeKVSduSQyTxRAZN6liW5bhvevn nyF+AXiSoJhBko7Gooho+NvoH8ZO6bNolunIEl89AIAuuSRM9hjm/pggOTOrgleaHSEj SSI1SUScXTmqsoI9vqBUQKgG6U9OYfAt9QNDauMkjNQT5pDsNlOknN0rAh0eIzWKtV4r dzCCv3YdYOok43y20SM94xK3h5EZIjbzLXgJP5tp2DfKvnCvZ7yVyVI9XD1lG8KLvln/ KdkuIyb7zN47jZktgT/E1mjEkIlDZbrWdNrCDlan/HGeluH0JwSIqOAZDTCcTpedQXND TnRw== X-Gm-Message-State: AOAM533rixMuQMGxKLlIrSuHdDr0OxOGsmsINnilcs8OM+KLXaQDgF2T dizuRQmpDGRfHGPWz4R4pASaWfILQOTz0Q== X-Received: by 2002:a7b:cc93:: with SMTP id p19mr7757552wma.175.1643383832029; Fri, 28 Jan 2022 07:30:32 -0800 (PST) Received: from orth.archaic.org.uk (orth.archaic.org.uk. [2001:8b0:1d0::2]) by smtp.gmail.com with ESMTPSA id j3sm4749485wrb.57.2022.01.28.07.30.31 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 28 Jan 2022 07:30:31 -0800 (PST) From: Peter Maydell 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 Message-Id: <20220128153009.2467560-18-peter.maydell@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220128153009.2467560-1-peter.maydell@linaro.org> References: <20220128153009.2467560-1-peter.maydell@linaro.org> MIME-Version: 1.0 X-Host-Lookup-Failed: Reverse DNS lookup failed for 2a00:1450:4864:20::32d (failed) Received-SPF: pass client-ip=2a00:1450:4864:20::32d; envelope-from=peter.maydell@linaro.org; helo=mail-wm1-x32d.google.com X-Spam_score_int: -12 X-Spam_score: -1.3 X-Spam_bar: - X-Spam_report: (-1.3 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, PDS_HP_HELO_NORDNS=0.001, RCVD_IN_DNSWL_NONE=-0.0001, RDNS_NONE=0.793, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" 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 Reviewed-by: Philippe Mathieu-Daudé Reviewed-by: Richard Henderson 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