From patchwork Tue Mar 15 20:43:06 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Peter Maydell X-Patchwork-Id: 551447 Delivered-To: patch@linaro.org Received: by 2002:a05:7000:6713:0:0:0:0 with SMTP id u19csp3789477mag; Tue, 15 Mar 2022 13:44:35 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyzwOqHODxWKzbW2yPUQXzjo21oG2skZbKE+ZCR0fqwMUv9JOAwUyNCgPx0v2AavkhBcEDI X-Received: by 2002:a25:3757:0:b0:633:8752:5612 with SMTP id e84-20020a253757000000b0063387525612mr1578664yba.135.1647377075177; Tue, 15 Mar 2022 13:44:35 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1647377075; cv=none; d=google.com; s=arc-20160816; b=dChLMKFr+SH39Of2edt7yoHFL9m8f7UQW7i5tYrebu4iSbcwYFX8CZ474Dvwti0/10 +8GLlms4U0Nm2Bh0xItQ2rE2edaFLpc6Eo4u/BF+BhPNSZ4oC7TQKWB4y5+BzMR9Uj/9 zdjfwkAAKuUspVKPeAVd3HLqm6dAKzgNlDydSegKNWvp1r/a97GMZVrmGGSBZfMhyG6R EZpJsaMcI8UCKdhdMdJIMuKhlNgyyBEQy3VBIZUoqRy2fKVeBaZHx4C4xmn4HA/NXmVW aw9UgvmaxHc3F1B2RuL7K+R3cnS37sv8RgqJo8GNmt/i7laPoul5id8RKmPlE35H30rw VekQ== 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=WycAF8d80bSEEtTzMR7OOBpkMnt1IEDbms0IgFG2ZfY=; b=fQXP6qIQwU5QaCc6BxZa9KyP0mhbFcolqO76dY0s+ggtK7sYbCqLYNKhFmWak6hkMf yeXebyzNvJlBoq6WWjvWO/ia5p3nkgKhuVjPwuVphKG+W2AmcGW4E/bNWVjcvbOyuLoS p1+9d+yBC0GKfHv2xmUKVyTfLxp31gKNhpPaF4qWV/A+HV/ZoMsmwWy77Lah4HpNE7og D6evayzhUBNmyxoGWD/leVJExpVKZa3Kxn7Hk4s3Z+egeHOtD1UqTDgSfjo0qS0e0Pyc BvJHNatHg1oFdXu/cHtJbFSbgVD337eqmfY5F0M703avyJ1DYG5aj9Wc4ReIiCOsgQF6 BUtA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=qTrH1bKM; 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 w6-20020a5b05c6000000b006242dc6cb54si212037ybp.275.2022.03.15.13.44.35 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 15 Mar 2022 13:44:35 -0700 (PDT) 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=qTrH1bKM; 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]:39448 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nUE1y-0006Y5-Kk for patch@linaro.org; Tue, 15 Mar 2022 16:44:34 -0400 Received: from eggs.gnu.org ([209.51.188.92]:51876) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nUE0l-0006VZ-RU for qemu-devel@nongnu.org; Tue, 15 Mar 2022 16:43:19 -0400 Received: from [2a00:1450:4864:20::42b] (port=33383 helo=mail-wr1-x42b.google.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1nUE0d-0008Fr-Pv for qemu-devel@nongnu.org; Tue, 15 Mar 2022 16:43:16 -0400 Received: by mail-wr1-x42b.google.com with SMTP id j17so311217wrc.0 for ; Tue, 15 Mar 2022 13:43:11 -0700 (PDT) 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=WycAF8d80bSEEtTzMR7OOBpkMnt1IEDbms0IgFG2ZfY=; b=qTrH1bKMHvU3tp4DRJ1MgFeGljvV30cJQwSJ62GKNVgJrvO+X/mu+71Sjw2O94ynuD G4w/oU8A1RbslVnbVvoCPE66OPb1A7txgvqOcgGXNSjDUWThN3pj+aLSF4DBe13HCoCO oJzspgsaM/RpWJh8zZ1Qdow/H1RxSdW9g0uDD6RNuSJndU2zmys2oTq8SolFDQmtn7I4 LAmYrWBQ8VjwxjC+HpCknbCeYeifnOlJYRwiGG0CSkkVyTcyxev7QESqKZUZAlE3jFIX e7Y/d4NhRwyLAdd8NOVwBPYPgTMy0tZE+l8SKD0IwS7Ccje1RJpCPUaoZA6G2vlMhVhz 1CFQ== 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=WycAF8d80bSEEtTzMR7OOBpkMnt1IEDbms0IgFG2ZfY=; b=MxbBJe8z/SbiD8OZ45W8YDB/4K+S3K6bVjRFrx8Q5lRUnwwEu9hEK4yHmAGCyObpcC m3BUVKGDbHjVvId/VDeG8B09mfK+n7s72nDI3QCbSEpiNMJfWd4GhzxyIAd1Xf7WPJTr RtYG1PnFZebHM8+hZAJ2e/FHaruG8VsWD2K30bptITW11eA6rF8m6Z8hr445Ngob+Bq5 UMO81ovKckv1L8z9GguMiHaC2TUNiLVHYviTujvRFq8vKTTcdcft5ZU9MCCY+4mO1nbn c6LfW5kwb8MpSnbFU/ZjJ4XXMGJn0eg3FQr/btU9ZwHD/KW0BcCTQ5OobEZqocNvBgQZ eI9w== X-Gm-Message-State: AOAM531Nt02vI9+Dwlmh2dtfiGWBadKqLLO8W/NAy9XGLRqvwkAktAQ2 5JTBKGPSpQNhOd6UaoQflda1NhXQ5/RK2A== X-Received: by 2002:a05:6000:12cf:b0:1f0:6875:9577 with SMTP id l15-20020a05600012cf00b001f068759577mr21141924wrx.304.1647376990443; Tue, 15 Mar 2022 13:43:10 -0700 (PDT) Received: from orth.archaic.org.uk (orth.archaic.org.uk. [2001:8b0:1d0::2]) by smtp.gmail.com with ESMTPSA id h11-20020a05600c414b00b0038c6c3eaee9sm465208wmm.1.2022.03.15.13.43.09 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 15 Mar 2022 13:43:10 -0700 (PDT) From: Peter Maydell To: qemu-arm@nongnu.org, qemu-devel@nongnu.org Subject: [PATCH 2/2] target/arm: Log fault address for M-profile faults Date: Tue, 15 Mar 2022 20:43:06 +0000 Message-Id: <20220315204306.2797684-3-peter.maydell@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220315204306.2797684-1-peter.maydell@linaro.org> References: <20220315204306.2797684-1-peter.maydell@linaro.org> MIME-Version: 1.0 X-Host-Lookup-Failed: Reverse DNS lookup failed for 2a00:1450:4864:20::42b (failed) Received-SPF: pass client-ip=2a00:1450:4864:20::42b; envelope-from=peter.maydell@linaro.org; helo=mail-wr1-x42b.google.com X-Spam_score_int: -6 X-Spam_score: -0.7 X-Spam_bar: / X-Spam_report: (-0.7 / 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.659, 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" For M-profile, the fault address is not always exposed to the guest in a fault register (for instance the BFAR bus fault address register is only updated for bus faults on data accesses, not instruction accesses). Currently we log the address only if we're putting it into a particular guest-visible register. Since we always have it, log it generically, to make logs of i-side faults a bit clearer. Signed-off-by: Peter Maydell Reviewed-by: Richard Henderson Reviewed-by: Alex Bennée --- target/arm/m_helper.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/target/arm/m_helper.c b/target/arm/m_helper.c index 3bd16c0c465..b7a0fe01141 100644 --- a/target/arm/m_helper.c +++ b/target/arm/m_helper.c @@ -2272,7 +2272,13 @@ void arm_v7m_cpu_do_interrupt(CPUState *cs) * Note that for M profile we don't have a guest facing FSR, but * the env->exception.fsr will be populated by the code that * raises the fault, in the A profile short-descriptor format. + * + * Log the exception.vaddress now regardless of subtype, because + * logging below only logs it when it goes into a guest visible + * register. */ + qemu_log_mask(CPU_LOG_INT, "...at fault address 0x%x\n", + (uint32_t)env->exception.vaddress); switch (env->exception.fsr & 0xf) { case M_FAKE_FSR_NSC_EXEC: /*