From patchwork Tue Oct 27 16:36:21 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ionela Voinescu X-Patchwork-Id: 11860847 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.8 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 1A523C388F9 for ; Tue, 27 Oct 2020 16:38:17 +0000 (UTC) Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) (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 A6B7121707 for ; Tue, 27 Oct 2020 16:38:16 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="TptftZoy" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org A6B7121707 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=arm.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=merlin.20170209; h=Sender:Content-Transfer-Encoding: Content-Type:MIME-Version:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:Message-Id:Date:Subject: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=KkY58s9+C5hZTn4moIBb9fh0Xb3gwc+bwCb/HttumhY=; b=TptftZoyxRxh1uDs23PxmF6RiN ABNBH70+oajTUexMcEv8hkUrpXMBIQDGGgfkxCkdrOyalHUbiuSz4ANnJ5glsa1Qt3LAd0HPyHunW 6BgUp3xygMy2OcJQ+7OBpD4qvmyoQp2/UlNLpMVHCXhM3QSmMcyzHiiy8c2KsIgtpdtrLD2zDAsPt dlq56Dx2hdtYoLQLY6KxHCwSlz5h0AW7kSNBUM2UNgnEQ1/SO5WRhU7b0gJDCFGVINzDeE5GFv2lt NEIyV5YHEEHW0U+5PY7yMa5Rp2jhIMVeSE/pIULBJKzsry80JJSppcWyQbW1MMWw0sBP/QdiWghUF rib0DqNw==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1kXRxp-0003s3-7U; Tue, 27 Oct 2020 16:36:49 +0000 Received: from foss.arm.com ([217.140.110.172]) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1kXRxl-0003r0-RJ for linux-arm-kernel@lists.infradead.org; Tue, 27 Oct 2020 16:36:46 +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 3CBA0139F; Tue, 27 Oct 2020 09:36:41 -0700 (PDT) Received: from e108754-lin.cambridge.arm.com (e108754-lin.cambridge.arm.com [10.1.199.49]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPA id C0A8D3F719; Tue, 27 Oct 2020 09:36:39 -0700 (PDT) From: Ionela Voinescu To: catalin.marinas@arm.com, will@kernel.org, sudeep.holla@arm.com Subject: [PATCH RESEND v2 0/3] arm64: cppc: add FFH support using AMUs Date: Tue, 27 Oct 2020 16:36:21 +0000 Message-Id: <20201027163624.20747-1-ionela.voinescu@arm.com> X-Mailer: git-send-email 2.17.1 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20201027_123645_952913_2794742F X-CRM114-Status: GOOD ( 12.14 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: souvik.chakravarty@arm.com, viresh.kumar@linaro.org, valentin.schneider@arm.com, linux-kernel@vger.kernel.org, dietmar.eggemann@arm.com, ionela.voinescu@arm.com, morten.rasmussen@arm.com, linux-arm-kernel@lists.infradead.org MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org This series adds support for CPPC's delivered and reference performance counters through the FFH methods by using the AMU equivalent core and constant cycle counters. This support is added in patch 3/3, while the first 2 patches generalise the existing AMU counter read and validation functionality to be reused for this usecase. The specification that drove this implementation can be found at [1], chapter 3.2. RESEND v2: rebase and retest on v5.10-rc1 v1 -> v2: - v1 can be found at [2] - The previous patch 1/4 was removed and a get_cpu_with_amu_feat() function was introduced instead, in 3/3, as suggested by Catalin. Given that most checks for the presence of AMUs is done at CPU level, followed by other validation, this implementation works better than the one initially introduced in v1/->patch 1/4. - Fixed warning reported by 0-day kernel test robot. - All build tests and FVP tests at [2] were re-run for this version. - This version is based on linux-next/20201001. [1] https://documentation-service.arm.com/static/5f106ad60daa596235e80081 [2] https://lore.kernel.org/lkml/20200826130309.28027-1-ionela.voinescu@arm.com/ Thank you, Ionela. Ionela Voinescu (3): arm64: wrap and generalise counter read functions arm64: split counter validation function arm64: implement CPPC FFH support using AMUs arch/arm64/include/asm/cpufeature.h | 11 +++ arch/arm64/include/asm/topology.h | 2 + arch/arm64/kernel/cpufeature.c | 8 +- arch/arm64/kernel/topology.c | 132 ++++++++++++++++++++++------ 4 files changed, 121 insertions(+), 32 deletions(-) base-commit: 3650b228f83adda7e5ee532e2b90429c03f7b9ec