From patchwork Fri May 3 23:24:02 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jeremy Linton X-Patchwork-Id: 163334 Delivered-To: patch@linaro.org Received: by 2002:a92:7e86:0:0:0:0:0 with SMTP id q6csp1197929ill; Fri, 3 May 2019 16:24:28 -0700 (PDT) X-Google-Smtp-Source: APXvYqw2sJSQHF8/eOg57juXf3nFq0Yli/1bSQcBYhktX0PHaJ+2aD+hnciUH4C3GmMG6wMET3Ea X-Received: by 2002:aa7:980e:: with SMTP id e14mr14905511pfl.142.1556925868729; Fri, 03 May 2019 16:24:28 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1556925868; cv=none; d=google.com; s=arc-20160816; b=JOiYr6aIOdO5STOZeAt9e5Cov0wxKEj8hgi04QqJAvKizyIrGHD8bH4JvvU+PDBcPG UzabsL5m/UepgHQsdNF1PKrJU565e0XVjKJIF4dZAcX9HuP92L5E+v+oJa3OUB2nX2ro gFE0VV6TMCGFA9DfrZw8mxc3Uqmzd7u2p1P77hiGrRF28501xrqPXCE63qFFoHg2S9g4 Iu33sup4d1d8hbkc6YlfUQCgFPVEvquGvub9aq3FHK7T6X4GclUB3YCDZze+C8uxbGdj 4+0aqMpI5+LO8FW4RlEUjz357gIY7CEFawnovhRmv9JZyOQ8ESF0llLsfxYXPc/VTXkw RL6A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from; bh=43wuGUmUJyXn8gKP66krVoDSZNXsoLpZpde1y4rXK1E=; b=JNT50WdgIc1FcqrAH7h1uyvFM7Y0T6wVY45rRE0e1Pvsz9ErQ14pl3T7BeuaKjI2iR EYDbCvXriZgmwhKAtgVI+gHhHJLBg5x4xb8hT950xoHqJVJaQjbGsQYX/GQEY8NVla3L b5s23DkPegT2V3g6Zx4MF7tHZV0nopse9qJnHanZILPvLZDUP7UvwmMBr7NJr4/MaJAh qN8DA+k5vue4xqktApS9NHiGqz622JZUTWFm+iKDhsWCgxRqj4TAhzkOXVTnRLhVCAEe Qv5sBwe0Axpb0HcH4f/eQp9z2+ccuvt8vQLkL4JXIB3kqd4N1RqL2+zN02tCdmzH7A7P pmAg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-acpi-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-acpi-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 x3si4677027plv.33.2019.05.03.16.24.28; Fri, 03 May 2019 16:24:28 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-acpi-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-acpi-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-acpi-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726302AbfECXY1 (ORCPT + 9 others); Fri, 3 May 2019 19:24:27 -0400 Received: from foss.arm.com ([217.140.101.70]:40186 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726059AbfECXY1 (ORCPT ); Fri, 3 May 2019 19:24:27 -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 B4A6815A2; Fri, 3 May 2019 16:24:26 -0700 (PDT) Received: from mammon-tx2.austin.arm.com (mammon-tx2.austin.arm.com [10.118.29.246]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPA id 268273F557; Fri, 3 May 2019 16:24:26 -0700 (PDT) From: Jeremy Linton To: linux-arm-kernel@lists.infradead.org Cc: linux-acpi@vger.kernel.org, catalin.marinas@arm.com, will.deacon@arm.com, rjw@rjwysocki.net, lenb@kernel.org, mark.rutland@arm.com, lorenzo.pieralisi@arm.com, sudeep.holla@arm.com, linuxarm@huawei.com, john.garry@huawei.com, Jeremy Linton Subject: [PATCH v3 0/5] arm64: SPE ACPI enablement Date: Fri, 3 May 2019 18:24:02 -0500 Message-Id: <20190503232407.37195-1-jeremy.linton@arm.com> X-Mailer: git-send-email 2.21.0 MIME-Version: 1.0 Sender: linux-acpi-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-acpi@vger.kernel.org This patch series enables the Arm Statistical Profiling Extension (SPE) on ACPI platforms. This is possible because ACPI 6.3 uses a previously reserved field in the MADT to store the SPE interrupt number, similarly to how the normal PMU is described. If a consistent valid interrupt exists across all the cores in the system, a platform device is registered. That then triggers the SPE module, which runs as normal. We also add the ability to parse the PPTT for IDENTICAL cores. We then use this to sanity check the single SPE device we create. This creates a bit of a problem with respect to the specification though. The specification says that its legal for multiple tree's to exist in the PPTT. We handle this fine, but what happens in the case of multiple tree's is that the lack of a common node with IDENTICAL set forces us to assume that there are multiple non-IDENTICAL cores in the machine. v2->v3: Previously a function pointer was being used to handle the more complex node checking required by the IDENTICAL flag. This version simply checks for the IDENTICAL flag and calls flag_identical() to preform the revision and next node checks. (I think after reading Raphael's comments for the Nth time, this is actually what he was suggesting, which I initially miss interpreted). Modify subject of first patch so that its clear a that its a capitalization change rather, than a logical C 'case' change. v1->v2: Wrap the code which creates the SPE device in a new CONFIG_ARM_SPE_ACPI ifdef. Move arm,spe-v1 device name into common header file Some comment/case sensitivity/function name changes. Jeremy Linton (5): ACPI/PPTT: Trivial, change the capitalization of CPU ACPI/PPTT: Add function to return ACPI 6.3 Identical tokens ACPI/PPTT: Modify node flag detection to find last IDENTICAL arm_pmu: acpi: spe: Add initial MADT/SPE probing perf: arm_spe: Enable ACPI/Platform automatic module loading arch/arm64/include/asm/acpi.h | 3 + drivers/acpi/pptt.c | 102 +++++++++++++++++++++++++--------- drivers/perf/Kconfig | 5 ++ drivers/perf/arm_pmu_acpi.c | 76 +++++++++++++++++++++++++ drivers/perf/arm_spe_pmu.c | 12 +++- include/linux/acpi.h | 5 ++ include/linux/perf/arm_pmu.h | 2 + 7 files changed, 176 insertions(+), 29 deletions(-) -- 2.21.0