Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp3907931imu; Fri, 30 Nov 2018 07:53:01 -0800 (PST) X-Google-Smtp-Source: AFSGD/VH9NV0QUID01zCVoYD5BRR8GNKiFhIVHUVQPnFYkPGOV3GEKKWOqvsvJisTmsk3+vWxuG8 X-Received: by 2002:a63:1e56:: with SMTP id p22mr5229269pgm.126.1543593181618; Fri, 30 Nov 2018 07:53:01 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1543593181; cv=none; d=google.com; s=arc-20160816; b=PcGv7j8PiHlQrze1rauEdwxrinlDAM9Hc4yODZb029Jr1K1Yjmp/6tjFQ1YG8t+xGY o4ZVTbdmBPMJ9Jts9jagsjmyQuLPP329171nhf9PP7dfkJ84XVX7XaD8eLnod1aejHwu jZDXQ7k72cJG1tAUAMQy8P/rPcaBcqQZVabk0jAG5yek73ETYnxv/bpWiy7mfhHpXVBA QWFxJBZw1YM47u+xJYLvTZpWizYERJ474Q0M3/MKBzjSwstbETweB6z7i5UWeMlzvGAv iRReLypRmnY0AFgP6WqN8qipTQSGMaaUbSQhVwABgR4Tw80xQWyz/SyP+8LrdztPoAsf 4C2Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:message-id:date:subject:cc :to:from; bh=UtQL/epaB/86cglJUQna7XnbjUR40ekmJ7hjSjjxJGc=; b=SN/yUe6WP9dn01HM2eudaw/MHYRhscvP3gAKzcS2AivX97efLe26dZaW707iAKBhs+ UHTQ8eKik1G+xi6+oQKxAbuzTcEbFybLJMFHs+DQukgQRdJJqBPFrlLCAE2Azt2xBZp3 UxPx+je1vO5hRnFPPG1juUZ0GAk/JUr4FMXczo74WEs3P9qtcrtacmdS3NYt63qVNfCa ax+vbCW/15mmcHLP5rY19nRwJSv1si/pQ77M9/XBvOhZRN1Dj6ROy5OvFguUsZu9wC5p 8ixEmJmGdYmco8/QiptaYGiSeqpmYFVnc6mpsN7Ktj0DcV1UPPtQrg5g6+0miULUOFeh t0dA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id f14si6396455pln.289.2018.11.30.07.52.42; Fri, 30 Nov 2018 07:53:01 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727561AbeLADAF (ORCPT + 99 others); Fri, 30 Nov 2018 22:00:05 -0500 Received: from szxga07-in.huawei.com ([45.249.212.35]:55110 "EHLO huawei.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1727520AbeLADAE (ORCPT ); Fri, 30 Nov 2018 22:00:04 -0500 Received: from DGGEMS404-HUB.china.huawei.com (unknown [172.30.72.58]) by Forcepoint Email with ESMTP id 29D941A345CF; Fri, 30 Nov 2018 23:49:19 +0800 (CST) Received: from S00345302A-PC.china.huawei.com (10.202.227.237) by DGGEMS404-HUB.china.huawei.com (10.3.19.204) with Microsoft SMTP Server id 14.3.408.0; Fri, 30 Nov 2018 23:49:12 +0800 From: Shameer Kolothum To: , CC: , , , , , , , , , , , , Subject: [PATCH v5 0/4] arm64 SMMUv3 PMU driver with IORT support Date: Fri, 30 Nov 2018 15:47:47 +0000 Message-ID: <20181130154751.28580-1-shameerali.kolothum.thodi@huawei.com> X-Mailer: git-send-email 2.12.0.windows.1 MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [10.202.227.237] X-CFilter-Loop: Reflected Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org This adds a driver for the SMMUv3 PMU into the perf framework. It includes an IORT update to support PM Counter Groups. This is based on the initial work done by Neil Leeder[1] SMMUv3 PMCG devices are named as smmuv3_pmcg_ where is the physical page address of the SMMU PMCG. For example, the PMCG at 0xff88840000 is named smmuv3_pmcg_ff88840 Usage example: For common arch supported events: perf stat -e smmuv3_pmcg_ff88840/transaction,filter_enable=1, filter_span=1,filter_stream_id=0x42/ -a netperf For IMP DEF events: perf stat -e smmuv3_pmcg_ff88840/event=id/ -a netperf This is sanity tested on a HiSilicon platform that requires a quirk to run it properly. As per HiSilicon erratum #162001800, PMCG event counter registers (SMMU_PMCG_EVCNTRn) on HiSilicon Hip08 platforms are read only and this prevents the software from setting the initial period on event start. Unfortunately we were a bit late in the cycle to detect this issue and now require software workaround for this. Patch #4 is added to this series to provide a workaround for this issue. Further testing on supported platforms are very much welcome. v4 ---> v5 -IORT code is modified to pass the option/quirk flags to the driver through platform_data (patch #4), based on Robin's comments. -Removed COMPILE_TEST (patch #2). v3 --> v4 -Addressed comments from Jean and Robin. -Merged dma config callbacks as per Lorenzo's comments(patch #1). -Added handling of Global(Counter0) filter settings mode(patch #2). -Added patch #4 to address HiSilicon erratum #162001800 - v2 --> v3 -Addressed comments from Robin. -Removed iort helper function to retrieve the PMCG reference smmu. -PMCG devices are now named using the base address v1 --> v2 - Addressed comments from Robin. - Added an helper to retrieve the associated smmu dev and named PMUs to make the association visible to user. - Added MSI support for overflow irq [1]https://www.spinics.net/lists/arm-kernel/msg598591.html Neil Leeder (2): acpi: arm64: add iort support for PMCG perf: add arm64 smmuv3 pmu driver Shameer Kolothum (2): perf/smmuv3: Add MSI irq support perf/smmuv3_pmu: Enable HiSilicon Erratum 162001800 quirk drivers/acpi/arm64/iort.c | 127 +++++-- drivers/perf/Kconfig | 9 + drivers/perf/Makefile | 1 + drivers/perf/arm_smmuv3_pmu.c | 859 ++++++++++++++++++++++++++++++++++++++++++ include/linux/acpi_iort.h | 3 + 5 files changed, 975 insertions(+), 24 deletions(-) create mode 100644 drivers/perf/arm_smmuv3_pmu.c -- 2.7.4