From patchwork Thu Feb 17 14:24:14 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Robin Murphy X-Patchwork-Id: 12750273 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 54833C433EF for ; Thu, 17 Feb 2022 14:32:27 +0000 (UTC) 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=FSNp86dSGxiGrsGQ1fRQu2SkHybwnmImb2v0lTojZJk=; b=Xc5TSm4dph4F9Y stprxlmNX1J2VHVYhOw5aDAoIzeXYNWTfp6d4aZY8cPGKoRCSh5EmqTEMU1omAYttpc9IACXjKNij pLeRlaCZG+uZP9nDFSEpfdyOCHYfjhGXlj0blU6pB2+hm39l7hhFj3N46m3bzL6Jlu2ZXTVp5c/d9 eDqhgHmnn6FKnUWviAuDsk5SzvU9zD4FY/esowOMVJZ5JJedwmqDqXt4mKMGGTDykqIdgw18B6DzP sBVVt3BOu3Yx8nzVXokqS4zXZ4FptuYkko28UdyoBPYPLTRxSQLfLXFxCU8ScK0BwLPzCd2ClDhR1 uLYkGYxgeH2h6BCnUFQA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1nKho0-00B1tJ-Vn; Thu, 17 Feb 2022 14:30:49 +0000 Received: from foss.arm.com ([217.140.110.172]) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1nKhhs-00AzQ0-FI for linux-arm-kernel@lists.infradead.org; Thu, 17 Feb 2022 14:24:30 +0000 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 5B1FE12FC; Thu, 17 Feb 2022 06:24:26 -0800 (PST) Received: from e121345-lin.cambridge.arm.com (e121345-lin.cambridge.arm.com [10.1.196.40]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPA id 3D69A3F718; Thu, 17 Feb 2022 06:24:25 -0800 (PST) From: Robin Murphy To: will@kernel.org, mark.rutland@arm.com Cc: lorenzo.pieralisi@arm.com, sudeep.holla@arm.com, linux-arm-kernel@lists.infradead.org, jean-philippe@linaro.org, leo.yan@linaro.org, noda.akio@socionext.com Subject: [PATCH 0/6] perf: Arm SMMU PMU driver Date: Thu, 17 Feb 2022 14:24:14 +0000 Message-Id: X-Mailer: git-send-email 2.28.0.dirty MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220217_062428_597396_AD21257D X-CRM114-Status: GOOD ( 11.41 ) 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 Hi all, Since our friends at Linaro had some interest in the area, I've dug up and finished off my old SMMUv1/v2 PMU driver, now with a slightly less terrible DT binding to boot. Patch #1 involves a general refactoring of the IRQ setup code in arm-smmu which also now serves to remove the general dependency on explicit IRQ resources for of_platform devices. ACPI support via IORT (patch #2) is pleasingly trivial, but does have a hard dependency on the previous patch, otherwise SMMU context interrupts may get messed up. The driver itself in patch #5 is still largely a time capsule of me learning the PMU APIs 5 years ago (as a warm-up for arm-cmn). I've mostly just added IRQ affinity support (which I didn't yet fully understand at the time) and tweaked a few comments. I'm pretty confident all the testing I did back then is still valid, so I've just run some quick sanity checks with patch #6 to verify the new DT binding. Cheers, Robin. Robin Murphy (6): iommu/arm-smmu: Account for PMU interrupts acpi/iort: Register SMMUv2 PMU interrupts iommu/arm-smmu: Add DT PMU support iommu/smmu: Create child devices for PMUs perf: Add ARM SMMU PMU driver arm64: dts: Add SMMU PMUs to Juno .../devicetree/bindings/iommu/arm,smmu.yaml | 19 +- arch/arm64/boot/dts/arm/juno-base.dtsi | 26 +- drivers/acpi/arm64/iort.c | 18 +- drivers/iommu/arm/arm-smmu/arm-smmu.c | 143 ++-- drivers/iommu/arm/arm-smmu/arm-smmu.h | 5 +- drivers/perf/Kconfig | 24 +- drivers/perf/Makefile | 1 + drivers/perf/arm-smmu-pmu.c | 732 ++++++++++++++++++ 8 files changed, 896 insertions(+), 72 deletions(-) create mode 100644 drivers/perf/arm-smmu-pmu.c