From patchwork Thu Sep 28 14:09:44 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Will Deacon X-Patchwork-Id: 114447 Delivered-To: patch@linaro.org Received: by 10.140.106.117 with SMTP id d108csp790150qgf; Thu, 28 Sep 2017 07:10:21 -0700 (PDT) X-Google-Smtp-Source: AOwi7QAjL+4ihC/rIoOezKBtDGRzNXQKhzrh7sBGWKi0a9kLuENjzVKCpxBk9NY6Kh0Z9XXu1Wrj X-Received: by 10.99.53.205 with SMTP id c196mr4411630pga.430.1506607821876; Thu, 28 Sep 2017 07:10:21 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1506607821; cv=none; d=google.com; s=arc-20160816; b=FB9FT0je90Xks7rFjBpaRJRy/jbsSmXNtEUfo5xDeXN9C/TSHJCLYtTk8aDpu/WXhl ta4eWRLc5ezqjjHNCEFbMEaE72I6YLFtXCegsaCEM/nDNbO/OzG6lfzUwIi3bXWVnoEx ncKj0YRRCk1Bh1qT3ee7bWpbp5GmRgWCtEmsIb7GflKgvRhGoiAwKzQVMiTwB34iSOFy 5/RFVaEd04ix3coULy+5dkgQWQwOfwnW0OQqVfQr+F8yzUVMcFcL7joeV12n30hMC+Eh W5hI+XLdEk77hcSQXMmmfd1O3BGNGbddC0O+Lx8GtYNCMgOdwkpTt37xkLow0o3fCH2i LCCQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from :arc-authentication-results; bh=vCnbUbkgPAOLNJJWo3+9Mk/BWGNcYayBSHwAeRw7lNw=; b=ay8yzbzZNLBkZqiXAmnMhTKtN5Jfj+bDopAn+do6TlngzjOc9GNxpPIHPiJ4jocprj 2UrGFjXJciKNhWJPgib/FxiqiBjNN1QSczaV/V7118Hb9bWZCbwsoq6P563zClDnUHvc AHRK5DDEgFYsxpoWuynAR9hFt/ZzuqV9Ard21o6C+pz91AaLYQVrTLeHgTs4xhLBqTyK QPoq0O0X795AOAdwASHTLj6FL9AIRBVSdMU4V3kwJRzz55WC1gWlEsZiMuflu5YXMnqV khc1Vpr/Cwbpxjji44cJRC2iYf5Xte2r11eM+tYgh88vc/v1GvA/1ofgEGY0ayFLIbUh 5D3Q== 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 t4si1498419plj.101.2017.09.28.07.10.21; Thu, 28 Sep 2017 07:10:21 -0700 (PDT) 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 S1752689AbdI1OJl (ORCPT + 26 others); Thu, 28 Sep 2017 10:09:41 -0400 Received: from usa-sjc-mx-foss1.foss.arm.com ([217.140.101.70]:58152 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750794AbdI1OJi (ORCPT ); Thu, 28 Sep 2017 10:09:38 -0400 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.72.51.249]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 088561435; Thu, 28 Sep 2017 07:09:38 -0700 (PDT) Received: from edgewater-inn.cambridge.arm.com (usa-sjc-imap-foss1.foss.arm.com [10.72.51.249]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPA id CCF783F483; Thu, 28 Sep 2017 07:09:37 -0700 (PDT) Received: by edgewater-inn.cambridge.arm.com (Postfix, from userid 1000) id 6245A1AE3036; Thu, 28 Sep 2017 15:09:52 +0100 (BST) From: Will Deacon To: linux-arm-kernel@lists.infradead.org Cc: marc.zyngier@arm.com, mark.rutland@arm.com, kim.phillips@arm.com, tglx@linutronix.de, peterz@infradead.org, alexander.shishkin@linux.intel.com, robh@kernel.org, suzuki.poulose@arm.com, pawel.moll@arm.com, mathieu.poirier@linaro.org, mingo@redhat.com, linux-kernel@vger.kernel.org, Will Deacon Subject: [PATCH v5 0/7] Add support for the ARMv8.2 Statistical Profiling Extension Date: Thu, 28 Sep 2017 15:09:44 +0100 Message-Id: <1506607791-8621-1-git-send-email-will.deacon@arm.com> X-Mailer: git-send-email 2.1.4 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi all, This is the seventh posting of the patches previously posted here: rfcv1: http://lists.infradead.org/pipermail/linux-arm-kernel/2017-January/476450.html rfcv2: http://lists.infradead.org/pipermail/linux-arm-kernel/2017-January/479387.html v1: http://lists.infradead.org/pipermail/linux-arm-kernel/2017-January/483684.html v2: http://lists.infradead.org/pipermail/linux-arm-kernel/2017-April/499938.html v3: http://lists.infradead.org/pipermail/linux-arm-kernel/2017-May/507132.html v4: http://lists.infradead.org/pipermail/linux-arm-kernel/2017-June/510799.html There have been many changes since v4, mainly thanks to useful review comments from Mark Rutland: * Require CAP_SYS_ADMIN for sampling physical addresses, the physical counter and context information (ASID/VMID) * Handle AUX buffer allocations when cpu == -1 * Fix PERF_IDX2OFF for non-power-of-2 pages buffer sizes * Use %016llx when printing PMBSR * Fix masking of PMSIRR_EL1.INTERVAL * Don't reject events based on sample period (for consistency with PERF_EVENT_IOC_PERIOD) * Consolidate isb() usage * Add of_device_id table sentinel to avoid overrunning ID table * Complete rewrite of __arm_spe_pmu_next_off, based on wakeup changes in core * Rename cnt_width to counter_sz * Ensure PMBPTR is aligned to record size when profiling is active * Complete rewrite of exception handling * Move register definitions into asm/sysreg.h * Now tested on FPGA (as opposed to just on the FastModel)! The architecture documentation is available here: https://developer.arm.com/products/architecture/a-profile/docs/ddi0586/latest/arm-architecture-reference-manual-supplement-statistical-profiling-extension-for-armv8-a and there's a high-level overview on this official ARM blog: https://community.arm.com/processors/b/blog/posts/statistical-profiling-extension-for-armv8-a All comments welcome, Will --->8 Will Deacon (7): genirq: export irq_get_percpu_devid_partition to modules perf/core: Export AUX buffer helpers to modules perf/core: Add PERF_AUX_FLAG_COLLISION to report colliding samples arm64: sysreg: Move SPE registers and PSB into common header files arm64: head: Init PMSCR_EL2.{PA,PCT} when entered at EL2 without VHE drivers/perf: Add support for ARMv8.2 Statistical Profiling Extension dt-bindings: Document devicetree binding for ARM SPE Documentation/devicetree/bindings/arm/spe-pmu.txt | 20 + arch/arm64/include/asm/barrier.h | 2 + arch/arm64/include/asm/sysreg.h | 93 ++ arch/arm64/kernel/head.S | 17 +- arch/arm64/kvm/hyp/debug-sr.c | 24 +- drivers/perf/Kconfig | 8 + drivers/perf/Makefile | 1 + drivers/perf/arm_spe_pmu.c | 1246 +++++++++++++++++++++ include/uapi/linux/perf_event.h | 1 + kernel/events/ring_buffer.c | 4 + kernel/irq/irqdesc.c | 1 + 11 files changed, 1395 insertions(+), 22 deletions(-) create mode 100644 Documentation/devicetree/bindings/arm/spe-pmu.txt create mode 100644 drivers/perf/arm_spe_pmu.c -- 2.1.4