From patchwork Thu Oct 10 02:52:08 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Davidlohr Bueso X-Patchwork-Id: 13829426 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 12884CEDDA9 for ; Thu, 10 Oct 2024 02:56:01 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Content-Transfer-Encoding: MIME-Version:Message-ID:Date:Subject:Cc:To:From:Reply-To:Content-Type: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References:List-Owner; bh=XhKU0AE1uncaAAcKjtVUJtMae/mmu+f96EkLUsuX8Lo=; b=hrzVdub9ikrhQguVQFIo9RT4at ASY0YRBC/gMNrTJOhIgUD1V8Mq7uamf6rKAIYSC7+qnoKoHyZozQsQwQbXviK0PP4G8DoR6rkFNUT TmHa7NO7zNvHsDkE1i5G84D8LnllfunFVEbiJdl0NFsdyTxGysGBcQ1iAQTuFzmOHSPJDP/NXWULf ImhubWttHA7YEDAlESgRr57GhZWClpyLrpf6uhVfaSaIzGTwcsWTzQHugvXRiZNnQeiGze4dIE27p Zyi7VYTIUFFRbns76FJbLEgJbiOrScaVDGvu4SUoASGGwEd1tAa/pA8qpyjFmBUyR+hR6h0r5167O s2Zz07Wg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98 #2 (Red Hat Linux)) id 1syjLA-0000000BLBR-1mi2; Thu, 10 Oct 2024 02:55:48 +0000 Received: from weasel.tulip.relay.mailchannels.net ([23.83.218.247]) by bombadil.infradead.org with esmtps (Exim 4.98 #2 (Red Hat Linux)) id 1syjJn-0000000BKqt-1c1H for linux-arm-kernel@lists.infradead.org; Thu, 10 Oct 2024 02:54:25 +0000 X-Sender-Id: dreamhost|x-authsender|dave@stgolabs.net Received: from relay.mailchannels.net (localhost [127.0.0.1]) by relay.mailchannels.net (Postfix) with ESMTP id 8E01782364A; Thu, 10 Oct 2024 02:54:18 +0000 (UTC) Received: from pdx1-sub0-mail-a216.dreamhost.com (100-96-90-148.trex-nlb.outbound.svc.cluster.local [100.96.90.148]) (Authenticated sender: dreamhost) by relay.mailchannels.net (Postfix) with ESMTPA id 26F9D823944; Thu, 10 Oct 2024 02:54:18 +0000 (UTC) ARC-Seal: i=1; s=arc-2022; d=mailchannels.net; t=1728528858; a=rsa-sha256; cv=none; b=DXwo0wHDooIwajanNpjwZHlIMbHIds85xQXHcBBY4yA9zJeuog7VXW/Czdy7wFV91SNpJv hDTUXFRzyOcESe18vLUySDTm7SFnmXOXKE5j6zYH//sFQRpCE0FdLo2y8jdAOFlcqkbEv1 4MA9rNHHZJI0+3U64VQvHpkk62YOLZLKtmJk8C0AqzI79RtnYt1492BYzjXzbOrZcPLDAh xdcmM97cxykKxkEP7IQpXbBCnODzX8RfnmaIdPur37wTr0+Ip1hZ1lJiQtt8tJHlfxxEfu qs1LuPuuHTIy14YU4q0nzw7xWs2xP6fIP3N5R5GAnajIxg0hMXqMdDXkCQHnSg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=mailchannels.net; s=arc-2022; t=1728528858; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding:dkim-signature; bh=XhKU0AE1uncaAAcKjtVUJtMae/mmu+f96EkLUsuX8Lo=; b=ZoX5FYJxmCUuks1gYvPlmT9M6/Dxa5zVWKIy04RbEQ1wuLJ7JbEIFBywYQakV/T8lIdDMv vOr9GP2sIvWfFCcY6gqGs6CSoyJlbm/RliuJKfkb7roZ9nm0ceH5V82ubXI3ZoNxjn1fqz +SfmjS1yW7jkK0vpIAnoniaw1qtX99nCjCCy/BR80NFETzU1FClO3reyNpF8B7XSSDDhjJ +C2f2jyTDlhewyNS14CsQ+XCyOrR4bjIDjqTSx6MbuJN4HI46iTxl9Nb29fNKROV4enpyT Hk6csSotOjZeqbj5mW+U3v2TYG0b0yLLxOnc4ktHgnWyXe/b9t4gDE7f4o0KZA== ARC-Authentication-Results: i=1; rspamd-5fcd6bf96c-hrs9w; auth=pass smtp.auth=dreamhost smtp.mailfrom=dave@stgolabs.net X-Sender-Id: dreamhost|x-authsender|dave@stgolabs.net X-MC-Relay: Neutral X-MailChannels-SenderId: dreamhost|x-authsender|dave@stgolabs.net X-MailChannels-Auth-Id: dreamhost X-Celery-Fearful: 696674c52a7c3ed1_1728528858456_1484141695 X-MC-Loop-Signature: 1728528858456:1036919767 X-MC-Ingress-Time: 1728528858456 Received: from pdx1-sub0-mail-a216.dreamhost.com (pop.dreamhost.com [64.90.62.162]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384) by 100.96.90.148 (trex/7.0.2); Thu, 10 Oct 2024 02:54:18 +0000 Received: from localhost.localdomain (ip72-199-50-187.sd.sd.cox.net [72.199.50.187]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) (Authenticated sender: dave@stgolabs.net) by pdx1-sub0-mail-a216.dreamhost.com (Postfix) with ESMTPSA id 4XPDqY1t83zB1; Wed, 9 Oct 2024 19:54:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=stgolabs.net; s=dreamhost; t=1728528858; bh=XhKU0AE1uncaAAcKjtVUJtMae/mmu+f96EkLUsuX8Lo=; h=From:To:Cc:Subject:Date:Content-Transfer-Encoding; b=qll/b0OIrAYom0ssIJgB40SniKGFufVwsOHiROJOLwrWA3bFrfzw2jPk0Aak3T3VM 7R53D7vrO95hlU9+tXDZWFRceDTJ9y39HvNkzH59ylC+6T9DZMdkPKX2UMR7JokSK5 qN4LTe/TJJ727+FcRRXgulWDeMQITfobFeGDYFe9KE4PUuByOYPA2hPtXwTTpuF/qH lL+1rGxx/JxgvZzbSOs7q9wPFA7uk6YysJodEzXsAPVOg4Fo4z60p8peYkD3rpZA3u IqGEa+Zd4Iwa0IyYl8vuU1kNf1wyWipwUH+YmxHm9g/OThPIUtT1sAkSumup2AmXyu OmnB4vNktovSQ== From: Davidlohr Bueso To: jonathan.cameron@huawei.com, will@kernel.org, mark.rutland@arm.com Cc: dave.jiang@intel.com, alison.schofield@intel.com, dan.j.williams@intel.com, ira.weiny@intel.com, fan.ni@samsung.com, a.manzanares@samsung.com, linux-cxl@vger.kernel.org, linux-arm-kernel@lists.infradead.org, dave@stgolabs.net, Jonathan Cameron Subject: [PATCH v3] perf/cxlpmu: Support missing events in 3.1 spec Date: Wed, 9 Oct 2024 19:52:08 -0700 Message-ID: <20241010025208.180458-1-dave@stgolabs.net> X-Mailer: git-send-email 2.46.1 MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20241009_195423_561872_1579B219 X-CRM114-Status: UNSURE ( 9.10 ) X-CRM114-Notice: Please train this message. X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Update the CXL PMU driver to support the new events introduced in the latest revision. These are: - read/write accesses with TEE constraints. - S2M indicating Modified state. Reviewed-by: Jonathan Cameron Reviewed-by: Alison Schofield Signed-off-by: Davidlohr Bueso --- drivers/perf/cxl_pmu.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/drivers/perf/cxl_pmu.c b/drivers/perf/cxl_pmu.c index 43d68b69e630..bee4b5b52ec6 100644 --- a/drivers/perf/cxl_pmu.c +++ b/drivers/perf/cxl_pmu.c @@ -354,7 +354,7 @@ static struct attribute *cxl_pmu_event_attrs[] = { CXL_PMU_EVENT_CXL_ATTR(d2h_req_wowrinvf, CXL_PMU_GID_D2H_REQ, BIT(13)), CXL_PMU_EVENT_CXL_ATTR(d2h_req_wrinv, CXL_PMU_GID_D2H_REQ, BIT(14)), CXL_PMU_EVENT_CXL_ATTR(d2h_req_cacheflushed, CXL_PMU_GID_D2H_REQ, BIT(16)), - /* CXL rev 3.0 Table 3-20 - D2H Repsonse Encodings */ + /* CXL rev 3.0 Table 3-20 - D2H Response Encodings */ CXL_PMU_EVENT_CXL_ATTR(d2h_rsp_rspihiti, CXL_PMU_GID_D2H_RSP, BIT(4)), CXL_PMU_EVENT_CXL_ATTR(d2h_rsp_rspvhitv, CXL_PMU_GID_D2H_RSP, BIT(6)), CXL_PMU_EVENT_CXL_ATTR(d2h_rsp_rspihitse, CXL_PMU_GID_D2H_RSP, BIT(5)), @@ -377,12 +377,14 @@ static struct attribute *cxl_pmu_event_attrs[] = { /* CXL rev 3.0 Table 13-5 directly lists these */ CXL_PMU_EVENT_CXL_ATTR(cachedata_d2h_data, CXL_PMU_GID_CACHE_DATA, BIT(0)), CXL_PMU_EVENT_CXL_ATTR(cachedata_h2d_data, CXL_PMU_GID_CACHE_DATA, BIT(1)), - /* CXL rev 3.0 Table 3-29 M2S Req Memory Opcodes */ + /* CXL rev 3.1 Table 3-35 M2S Req Memory Opcodes */ CXL_PMU_EVENT_CXL_ATTR(m2s_req_meminv, CXL_PMU_GID_M2S_REQ, BIT(0)), CXL_PMU_EVENT_CXL_ATTR(m2s_req_memrd, CXL_PMU_GID_M2S_REQ, BIT(1)), CXL_PMU_EVENT_CXL_ATTR(m2s_req_memrddata, CXL_PMU_GID_M2S_REQ, BIT(2)), CXL_PMU_EVENT_CXL_ATTR(m2s_req_memrdfwd, CXL_PMU_GID_M2S_REQ, BIT(3)), CXL_PMU_EVENT_CXL_ATTR(m2s_req_memwrfwd, CXL_PMU_GID_M2S_REQ, BIT(4)), + CXL_PMU_EVENT_CXL_ATTR(m2s_req_memrdtee, CXL_PMU_GID_M2S_REQ, BIT(5)), + CXL_PMU_EVENT_CXL_ATTR(m2s_req_memrddatatee, CXL_PMU_GID_M2S_REQ, BIT(6)), CXL_PMU_EVENT_CXL_ATTR(m2s_req_memspecrd, CXL_PMU_GID_M2S_REQ, BIT(8)), CXL_PMU_EVENT_CXL_ATTR(m2s_req_meminvnt, CXL_PMU_GID_M2S_REQ, BIT(9)), CXL_PMU_EVENT_CXL_ATTR(m2s_req_memcleanevict, CXL_PMU_GID_M2S_REQ, BIT(10)), @@ -404,10 +406,11 @@ static struct attribute *cxl_pmu_event_attrs[] = { CXL_PMU_EVENT_CXL_ATTR(s2m_bisnp_curblk, CXL_PMU_GID_S2M_BISNP, BIT(4)), CXL_PMU_EVENT_CXL_ATTR(s2m_bisnp_datblk, CXL_PMU_GID_S2M_BISNP, BIT(5)), CXL_PMU_EVENT_CXL_ATTR(s2m_bisnp_invblk, CXL_PMU_GID_S2M_BISNP, BIT(6)), - /* CXL rev 3.0 Table 3-43 S2M NDR Opcopdes */ + /* CXL rev 3.1 Table 3-50 S2M NDR Opcopdes */ CXL_PMU_EVENT_CXL_ATTR(s2m_ndr_cmp, CXL_PMU_GID_S2M_NDR, BIT(0)), CXL_PMU_EVENT_CXL_ATTR(s2m_ndr_cmps, CXL_PMU_GID_S2M_NDR, BIT(1)), CXL_PMU_EVENT_CXL_ATTR(s2m_ndr_cmpe, CXL_PMU_GID_S2M_NDR, BIT(2)), + CXL_PMU_EVENT_CXL_ATTR(s2m_ndr_cmpm, CXL_PMU_GID_S2M_NDR, BIT(3)), CXL_PMU_EVENT_CXL_ATTR(s2m_ndr_biconflictack, CXL_PMU_GID_S2M_NDR, BIT(4)), /* CXL rev 3.0 Table 3-46 S2M DRS opcodes */ CXL_PMU_EVENT_CXL_ATTR(s2m_drs_memdata, CXL_PMU_GID_S2M_DRS, BIT(0)),