From patchwork Fri Jan 28 15:29:55 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Peter Maydell X-Patchwork-Id: 537597 Delivered-To: patch@linaro.org Received: by 2002:ac0:f7d2:0:0:0:0:0 with SMTP id i18csp741281imr; Fri, 28 Jan 2022 07:58:40 -0800 (PST) X-Google-Smtp-Source: ABdhPJx6gbN7UjLerhqA+C3mEb1MMJOvg8dfoHjexSTpJZzDNpWkESMe/UgjGR1QSiOK4PCNM1FA X-Received: by 2002:a05:6902:1003:: with SMTP id w3mr13251818ybt.329.1643385520286; Fri, 28 Jan 2022 07:58:40 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1643385520; cv=none; d=google.com; s=arc-20160816; b=l/bDCa7cIuZXb2CVH8Y/2ldDzTf9kbxc/x7AdinAn78flh+z1TbZ5IgZWlGU+s5yH1 P0yM4EMvXyuVRNdC2kJTMip5MHf8ZdEXJqDsdHWzH2j6MszwH+9m2X3fdMmE/dfvXRfI ejmIP8dFNrFm0NLAYbVlNxtmhUDcDGvjFAxfUGzqTfwRHcmqeMT/W65Vb7Vla7k5Wi2H fl4c1IQ5txXVgIi4mX1fh/JHzOM3K9VilA7ldNpzyzvni/cFMJ0kE4KB6fNUoLBQ2twR fLengmTY7FMvx1rl8cN1fY4LyXyyoWGa3ST4mWKzud5dsbJbENCskSPzg+jgK/SwPgZV yYeQ== 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=6AFIn/f/7IpE65Fj0RvUnSwaSc0ueBDTSsB7uefk3zA=; b=hF+raGSwVLmthFjUkyzjIrvL8rH2Qv6Fw1rGG5B4bBamviCfiUPzvo05JnGTYMmnt7 j5Fiy2ewsRFBUwoWaKndoFJJpSzK7YfjmhlmIlSHa8mkX7h5NCUSm0oIunkFM9NyUV0C OufKg9axnELcqMOAoT3hk8ONd3WNOdV4bxlNnJLNJzS8lzIxVURBHDEPHndNzWOxdXAP dJ5gfrUSzzzsxIugFhBY68ofQMevToj3o3csZ6m42NHSJD+aRSSCiKVOsrYqsNLcUv08 PNV6wRGOORacpZxzpC4YIdX23Vy1iteJ2FNWMM1y8yfQEa3MbvrNa1u5P6G5pSP1yJl0 d1UA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=qHTbop0Y; 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 m197si30346552ybf.2.2022.01.28.07.58.40 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 28 Jan 2022 07:58:40 -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=qHTbop0Y; 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]:38966 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nDTe3-0001m7-NZ for patch@linaro.org; Fri, 28 Jan 2022 10:58:39 -0500 Received: from eggs.gnu.org ([209.51.188.92]:57634) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nDTD5-0002AX-Po for qemu-devel@nongnu.org; Fri, 28 Jan 2022 10:30:52 -0500 Received: from [2a00:1450:4864:20::332] (port=45863 helo=mail-wm1-x332.google.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1nDTCy-0006Q8-P9 for qemu-devel@nongnu.org; Fri, 28 Jan 2022 10:30:44 -0500 Received: by mail-wm1-x332.google.com with SMTP id j5-20020a05600c1c0500b0034d2e956aadso4289889wms.4 for ; Fri, 28 Jan 2022 07:30:33 -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=6AFIn/f/7IpE65Fj0RvUnSwaSc0ueBDTSsB7uefk3zA=; b=qHTbop0YkryFBFpxKhCJ0mIHE0N6+w2J/rPnPKielMyGGLDAe2wWa9Rr41qi8QV9zZ zR6oS8L71t/Std3Q/90xtYilE7UjyhM/fJ5Uxb9cs579eaz17al31yfV5MNxlHNv8Cc3 v580twkv72Mn/xx8SQXdELW1VrAvz58wIoDScu9DEDn4BoNMG69X7AmYtO281NTfF8S3 Lm1nHXO2/D6V7fd/SWZcSvr0EJF0eS0xAgD4TIg3hZ/wPgbOVmbBEGxu4VmWqzd/oGKx QKcTxXOSEkdb8VHLH40DkkOzakBkMMkP5YAevkfFM+1Qc4Arh4+09fu/fmId81qnWSgp xvPw== 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=6AFIn/f/7IpE65Fj0RvUnSwaSc0ueBDTSsB7uefk3zA=; b=IjbyIFawGSAVjLU6seGIJ8ui0dI4ARlAds6a5Ygh464OQ4z0WsjxO/6rOxOIGB77+7 h7lNhPBDR3rS7U61j68x6N6LGgbJGymWZ9xaKnld4T4Qb9hrTTWxK6gcWrXPbHmJlvxY NqHTspjPIZchE/GLsmhob3/AE94o6+rjRgxDo+xlOn9ShXrctabc65NzIhOcjcpCOicL N/5pywC8OCmYXIWZ5ZRaAukzMjY3W/mb794y/S3vIRN+pGrDW3syWWWDHgVAdKwt5EJR Ht3LIulVRqsNU7UvOr9W8MCaGfo7YHhW8dBSZNmzRV4VodS0agHhPn9aazQusL289wUH ypJQ== X-Gm-Message-State: AOAM533daufJ6dbfFZa58lHAkdbqg4VADEl+xiXBcg9IeZJ/XoFHYRMv wylLEsCqw2FwnwcPNg+nluo8xTNma8eJEg== X-Received: by 2002:a05:600c:ac7:: with SMTP id c7mr2749197wmr.61.1643383832805; 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.32 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 28 Jan 2022 07:30:32 -0800 (PST) From: Peter Maydell To: qemu-devel@nongnu.org Subject: [PULL 18/32] hw/intc/arm_gicv3_its: Add tracepoints Date: Fri, 28 Jan 2022 15:29:55 +0000 Message-Id: <20220128153009.2467560-19-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::332 (failed) Received-SPF: pass client-ip=2a00:1450:4864:20::332; envelope-from=peter.maydell@linaro.org; helo=mail-wm1-x332.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" The ITS currently has no tracepoints; add a minimal set that allows basic monitoring of guest register accesses and reading of commands from the command queue. Signed-off-by: Peter Maydell Reviewed-by: Philippe Mathieu-Daudé Reviewed-by: Richard Henderson Message-id: 20220122182444.724087-3-peter.maydell@linaro.org --- hw/intc/arm_gicv3_its.c | 11 +++++++++++ hw/intc/trace-events | 8 ++++++++ 2 files changed, 19 insertions(+) diff --git a/hw/intc/arm_gicv3_its.c b/hw/intc/arm_gicv3_its.c index b2f6a8c7f00..6d2549e64b1 100644 --- a/hw/intc/arm_gicv3_its.c +++ b/hw/intc/arm_gicv3_its.c @@ -13,6 +13,7 @@ #include "qemu/osdep.h" #include "qemu/log.h" +#include "trace.h" #include "hw/qdev-properties.h" #include "hw/intc/arm_gicv3_its_common.h" #include "gicv3_internal.h" @@ -634,6 +635,8 @@ static void process_cmdq(GICv3ITSState *s) cmd = (data & CMD_MASK); + trace_gicv3_its_process_command(rd_offset, cmd); + switch (cmd) { case GITS_CMD_INT: result = process_its_cmd(s, data, cq_offset, INTERRUPT); @@ -818,6 +821,8 @@ static MemTxResult gicv3_its_translation_write(void *opaque, hwaddr offset, bool result = true; uint32_t devid = 0; + trace_gicv3_its_translation_write(offset, data, size, attrs.requester_id); + switch (offset) { case GITS_TRANSLATER: if (s->ctlr & R_GITS_CTLR_ENABLED_MASK) { @@ -1107,6 +1112,7 @@ static MemTxResult gicv3_its_read(void *opaque, hwaddr offset, uint64_t *data, qemu_log_mask(LOG_GUEST_ERROR, "%s: invalid guest read at offset " TARGET_FMT_plx "size %u\n", __func__, offset, size); + trace_gicv3_its_badread(offset, size); /* * The spec requires that reserved registers are RAZ/WI; * so use false returns from leaf functions as a way to @@ -1114,6 +1120,8 @@ static MemTxResult gicv3_its_read(void *opaque, hwaddr offset, uint64_t *data, * the caller, or we'll cause a spurious guest data abort. */ *data = 0; + } else { + trace_gicv3_its_read(offset, *data, size); } return MEMTX_OK; } @@ -1140,12 +1148,15 @@ static MemTxResult gicv3_its_write(void *opaque, hwaddr offset, uint64_t data, qemu_log_mask(LOG_GUEST_ERROR, "%s: invalid guest write at offset " TARGET_FMT_plx "size %u\n", __func__, offset, size); + trace_gicv3_its_badwrite(offset, data, size); /* * The spec requires that reserved registers are RAZ/WI; * so use false returns from leaf functions as a way to * trigger the guest-error logging but don't return it to * the caller, or we'll cause a spurious guest data abort. */ + } else { + trace_gicv3_its_write(offset, data, size); } return MEMTX_OK; } diff --git a/hw/intc/trace-events b/hw/intc/trace-events index 9aba7e3a7a4..b28cda4e08e 100644 --- a/hw/intc/trace-events +++ b/hw/intc/trace-events @@ -169,6 +169,14 @@ gicv3_redist_badwrite(uint32_t cpu, uint64_t offset, uint64_t data, unsigned siz gicv3_redist_set_irq(uint32_t cpu, int irq, int level) "GICv3 redistributor 0x%x interrupt %d level changed to %d" gicv3_redist_send_sgi(uint32_t cpu, int irq) "GICv3 redistributor 0x%x pending SGI %d" +# arm_gicv3_its.c +gicv3_its_read(uint64_t offset, uint64_t data, unsigned size) "GICv3 ITS read: offset 0x%" PRIx64 " data 0x%" PRIx64 " size %u" +gicv3_its_badread(uint64_t offset, unsigned size) "GICv3 ITS read: offset 0x%" PRIx64 " size %u: error" +gicv3_its_write(uint64_t offset, uint64_t data, unsigned size) "GICv3 ITS write: offset 0x%" PRIx64 " data 0x%" PRIx64 " size %u" +gicv3_its_badwrite(uint64_t offset, uint64_t data, unsigned size) "GICv3 ITS write: offset 0x%" PRIx64 " data 0x%" PRIx64 " size %u: error" +gicv3_its_translation_write(uint64_t offset, uint64_t data, unsigned size, uint32_t requester_id) "GICv3 ITS TRANSLATER write: offset 0x%" PRIx64 " data 0x%" PRIx64 " size %u requester_id 0x%x" +gicv3_its_process_command(uint32_t rd_offset, uint8_t cmd) "GICv3 ITS: processing command at offset 0x%x: 0x%x" + # armv7m_nvic.c nvic_recompute_state(int vectpending, int vectpending_prio, int exception_prio) "NVIC state recomputed: vectpending %d vectpending_prio %d exception_prio %d" nvic_recompute_state_secure(int vectpending, bool vectpending_is_s_banked, int vectpending_prio, int exception_prio) "NVIC state recomputed: vectpending %d is_s_banked %d vectpending_prio %d exception_prio %d"