From patchwork Tue Nov 16 11:35:35 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jean-Philippe Brucker X-Patchwork-Id: 12692755 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 mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 6C364C433F5 for ; Tue, 16 Nov 2021 11:54:12 +0000 (UTC) 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 mail.kernel.org (Postfix) with ESMTPS id 381BA60ED3 for ; Tue, 16 Nov 2021 11:54:12 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 381BA60ED3 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=linaro.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:Message-Id:Date:Subject:Cc :To:From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References: List-Owner; bh=MSOw5HmKWNCkO+2f5DJs9h7HCzL0GkwFNf5QZh4AVwY=; b=M+wwENauLo+i+q p7MKRs2EHA9nOrTJnn15rM5VWBAYzQxofZLK7YZr5mwMtCo+FsGyX88Z6ksD7X5txvCjH1fpjLzvW DNUjfZrtYjArSlAJDBozyaBWKT81RfsPPxv34TUJfj+x6incbxq/GVgcNl7QbV1loZGn8u1Rc6ZDn XFpIYq7jXUuZ7kJBI2oEiPQ02Q+nYBj6YupVnu1PMwTQxMGN9uPLLSjVWZ8e6ObX3601KgYEiRYaF 0PvlqJZN3TRV9ldNI3BtU/qoSk871pFh8Vo6trsQm06+XJVdKKAwO/8ebSt15qfshowsg+nuzmCZW ZLmsYsNqYa6fVZw9BlyQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1mmx0z-001Ym0-CT; Tue, 16 Nov 2021 11:52:41 +0000 Received: from mail-wr1-x434.google.com ([2a00:1450:4864:20::434]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1mmx0Z-001YWz-E3 for linux-arm-kernel@lists.infradead.org; Tue, 16 Nov 2021 11:52:17 +0000 Received: by mail-wr1-x434.google.com with SMTP id b12so37055734wrh.4 for ; Tue, 16 Nov 2021 03:52:14 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=7+tviJRIIqKFH/joMd9Q2VuwL2kp++/vcVTuNBiLmTY=; b=HuQiMtiZzY3tdoruvkLz+dFNF4HPYoYbLJTFSRlg4HRZnlHKcnqq1IoO4ZwobFLcRC BQZ6XgkY4SsDEhJKABgXqn/SfHerqbyeRYxCM0hy3QXPz3W6CFGZdEbDHxlmtyQ+BKgp VW9hUr6mhhmm2e4Y20CvwcO/knaFw/blt4cbVZHY6YcS0BlYchEgzdel/4n5GYIl1M1k a01lUXY5YzDpacvANaEX2KcmlG5rrkTYYLlbv1TQJjULgaC00SfTJOL0s7SMq9TKFYSE 4WRItc2FbEBFER611wRJJ/I1iKKcxSapImMYriUx2q0dowq8HHTxXFHAyolm2jnb6EDK 5dpg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=7+tviJRIIqKFH/joMd9Q2VuwL2kp++/vcVTuNBiLmTY=; b=BgrJPw6M8MbWQghSIJpkPFCDIbBuSz72yKejoI2TlM201CaFN4sHeMUbqc+M1oD83C 6m4uuhtrpsKw1gjtLbMyCN4DuLWaGgtlVywRaHx4V8VFPRf8zI7YJOqj+XGrBWPodHMy JzNYzeWGcdnQ8ZOsaXPuRXcAOLtIzCEIrNxOplj24HU1+raCxEvLL1qVmbxdHFBPhX0D 8YAbvKBID7wZNTP8WQBzneD0l73ADPcsnZFDVjfnsP7Bhd66STI+J1GP9IN+crFBAnM7 +iWKXORz2x2wl2H7W4uc/nSWBoR1lPmdXp2gLSLxXVGUjW2khPw2YSMXL5I1z11VjFLd xVgA== X-Gm-Message-State: AOAM532Dgi1MZuG6Td+XhkzGDc2BeMrD8Nd/qBYXfDiIRu8DVPL6d+SF QxRALFtJAQI172EhvwCUqJiPkQ== X-Google-Smtp-Source: ABdhPJzoIAXoYG38x1WM1fYsQvGCoCy5YoncrC23En2Ic65ARoZ2im8YfvNnsAezImOGHOPPsguxAA== X-Received: by 2002:a05:6000:144a:: with SMTP id v10mr8881733wrx.315.1637063533400; Tue, 16 Nov 2021 03:52:13 -0800 (PST) Received: from localhost.localdomain (cpc92880-cmbg19-2-0-cust679.5-4.cable.virginm.net. [82.27.106.168]) by smtp.gmail.com with ESMTPSA id b6sm2232846wmq.45.2021.11.16.03.52.12 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 16 Nov 2021 03:52:12 -0800 (PST) From: Jean-Philippe Brucker To: robh+dt@kernel.org Cc: iommu@lists.linux-foundation.org, devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, will@kernel.org, robin.murphy@arm.com, joro@8bytes.org, mark.rutland@arm.com, jkchen@linux.alibaba.com, leo.yan@linaro.org, uchida.jun@socionext.com, Jean-Philippe Brucker Subject: [PATCH 0/2] perf/smmuv3: Support devicetree Date: Tue, 16 Nov 2021 11:35:35 +0000 Message-Id: <20211116113536.69758-1-jean-philippe@linaro.org> X-Mailer: git-send-email 2.33.1 MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20211116_035215_541088_D1CE697C X-CRM114-Status: GOOD ( 12.45 ) 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 Add devicetree binding for the SMMUv3 PMU, called Performance Monitoring Counter Group (PMCG) in the spec. Each SMMUv3 implementation can have multiple independent PMCGs, for example one for the Translation Control Unit (TCU) and one per Translation Buffer Unit (TBU). I previously sent the binding as reply to Jay Chen's thread implementing device tree support [1]. This posting addresses the comments from that thread. Patch 1 adds two compatible strings. "arm,smmu-v3-pmcg" is common to all PMCGs. "hisilicon,smmu-v3-pmcg-hip08" allows to support the same quirk as IORT for that implementation (see patch 2). We'll probably want to also introduce compatible strings for each implementation that has additional perf events. For example the MMU-600 implementation has different events for TCU and TBU PMCGs [2], but both components have the same device IDs. So the driver could differentiate them if they had two distinct compatible strings such as "arm,mmu-600-pmcg-tbu" and "arm,mmu-600-pmcg-tcu". The series doesn't deal with this because for testing I use a software model which only implements architected events. I do not include DTS change for that platform because enabling PMCGs requires an additional model option. See my branch smmu/pmu-dt [3] for details. [1] https://lore.kernel.org/all/20200707150114.GC159413@myrica/ [2] https://developer.arm.com/documentation/100310/0202/Functional-description/Operation/Performance-Monitoring-Unit [3] https://jpbrucker.net/git/linux/log/?h=smmu/pmu-dt Jean-Philippe Brucker (2): dt-bindings: Add Arm SMMUv3 PMCG binding perf/smmuv3: Add devicetree support .../bindings/iommu/arm,smmu-v3-pmcg.yaml | 67 +++++++++++++++++++ drivers/perf/arm_smmuv3_pmu.c | 25 ++++++- 2 files changed, 90 insertions(+), 2 deletions(-) create mode 100644 Documentation/devicetree/bindings/iommu/arm,smmu-v3-pmcg.yaml