From patchwork Wed May 12 21:17:44 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mike Leach X-Patchwork-Id: 12254683 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=-12.4 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=ham 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 608E2C433ED for ; Wed, 12 May 2021 21:21:17 +0000 (UTC) Received: from desiato.infradead.org (desiato.infradead.org [90.155.92.199]) (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 AFE8A611C9 for ; Wed, 12 May 2021 21:21:16 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org AFE8A611C9 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=linaro.org 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=desiato.20200630; h=Sender:Content-Transfer-Encoding :Content-Type:MIME-Version:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id: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=etFaLCqf/xYT0A2fngJxYTtq8u6aHwfdIyehKgoxt88=; b=k85HqrUsggyjeKteJxUrfaBPax xTHPePpAR80azAqrzRLlT5O5keR1FrDIEh4pyJfFtzHvCwwSLsCw8jhI06C1Lg0eOzHjTQyko9KSw LLMrJ1+5GURpoGK0zeZn9S7+3CjG+w5dSzENjCeIWFaaXbjyVFm/CBS20asp1iUih+7vYAhsvCQB0 z1USENbC/Ghd7Qk3GC7aGf+OGdLdVfmhAMNOzXJOgxOpLmMYbLvIEqmdCFklDnbrX+uIrF/4nvkR/ kXLz8WQ4/RBjM70O9z0w6xledDLDmcm8Sv+OSAMpDZIpjTDAribk69cLz9bmc+e2y3pdveoUBNRWn ndZnwmDQ==; Received: from localhost ([::1] helo=desiato.infradead.org) by desiato.infradead.org with esmtp (Exim 4.94 #2 (Red Hat Linux)) id 1lgwFP-0040Vu-4l; Wed, 12 May 2021 21:18:27 +0000 Received: from bombadil.infradead.org ([2607:7c80:54:e::133]) by desiato.infradead.org with esmtps (Exim 4.94 #2 (Red Hat Linux)) id 1lgwF5-0040Se-0J for linux-arm-kernel@desiato.infradead.org; Wed, 12 May 2021 21:18:10 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20210309; h=Message-Id:Date:Subject:Cc:To:From: Sender:Reply-To:MIME-Version:Content-Type:Content-Transfer-Encoding: Content-ID:Content-Description:In-Reply-To:References; bh=zAtr2q3nCQbYHTFd/jDaEpkKtfT328sXeBu+iQCM+nI=; b=ajl+5JZEA0aIkdH416U5RtqYIN RCKMQGpU/nuhTQAUvIk+Sq7U0rlRNaNdsB1Dz7OXN+3rW4g0Lzlb7yPhi4mS3xmALRUlhEyhq9kFr rKLxP/8e/yUWUfxfu+p2Cg1M511bUuO19MH9nQwtn5KYC/SrETJXWUQM+6tzXSLMXFN/uFbd/hqPS 6P+8ANPyeVg7BWaiaAWjFJSi6spTpJHtcFSo1Euji8IAQKdtIxegCcfKe/kCWsYREWw7//sg1x3Ky mS/Rn2xoP1nnwkdTAHiqrRXFHA6aEchkYelB8dp6hrdhsghijzLlW0MEAP/z6FNlY03RAOgCe5H6E rRhIELbg==; Received: from mail-wr1-x434.google.com ([2a00:1450:4864:20::434]) by bombadil.infradead.org with esmtps (Exim 4.94 #2 (Red Hat Linux)) id 1lgwF2-00Apem-4u for linux-arm-kernel@lists.infradead.org; Wed, 12 May 2021 21:18:05 +0000 Received: by mail-wr1-x434.google.com with SMTP id z17so5942690wrq.7 for ; Wed, 12 May 2021 14:18:02 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id; bh=zAtr2q3nCQbYHTFd/jDaEpkKtfT328sXeBu+iQCM+nI=; b=QmCyM1AvS6yc3kvX/8YGm1hebNl/G8Ebm0EZ8Ybc5EWjWnXLd6iYTqoQib0FfaPJ9r 9YiwVKmUiljsZhGLCxT+d5qL0EChLV3gLGM/gAGOH2DQ3k6zuBD6LT1SOhZn5PJKEuEp 8TK3l5rltE6+yZq6X3bwywliosolJ6l7ci+iZn6u/ybo3mXcBmoAfL6OY5IhKRsEVwAC yl3Ad7q+t7pYBMiyKwxtWMvdvjLKAb7CSomT9OySfYebxkfqxt++cG9+81AuN5z1T1Qm Fm3LRQKSBeqtx92aPl2VWu/pwOVQmNn33ULXgZ+YjljHFcrOe46ORQjXH/J4p2DXyDuq iRuQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=zAtr2q3nCQbYHTFd/jDaEpkKtfT328sXeBu+iQCM+nI=; b=U48Uni2B6BAEpVy7hJ2J8DRHkVk3Tuy8x72vLSEeaGnhRy6sPHcEW33f6ZdvmiYa5i aucosvOTCI6PEwB1Gm76DnK8M6m+5zAcG8/mGHKKpf3KVcON9RmmXV9xPy07DgYjQsDN tn+HysnUebZZm8LH1KrdJE4Gv48mEHcWpgiRemDwkWA574DfB/wTNMg8GnCA/y12pqum ZKp3qPNBkVaeNXBh92BolSOTT3+k1z4ZgifP0XoOd0gNDHmopOFQCeewGpz9miLK+S7L 7bCfzI121DsX0+JNDR2dL10nL2wMGZmCYkFh2yo7COm6Btc+RloDTnhEUZFov+CyxnLa CVdQ== X-Gm-Message-State: AOAM530bDwLPnd5HhY+d3qJrkE09jfM+PqrpPAGRXV7KtiSkZ4RJPoEi TZ/u84NkIS2b/JypE3i/7sO0KtfWZn7mrg== X-Google-Smtp-Source: ABdhPJzwDa0aZQval8zgi7YvzTFc+r2/Uaso+XJFdISvWjN3DKpTB9aSA5uLeZsuCRv2SY2J2h6wOA== X-Received: by 2002:adf:f50c:: with SMTP id q12mr47641117wro.23.1620854281508; Wed, 12 May 2021 14:18:01 -0700 (PDT) Received: from linaro.org ([2a00:23c5:6809:2201:3d54:dc15:c65b:180c]) by smtp.gmail.com with ESMTPSA id e10sm908745wrw.20.2021.05.12.14.18.00 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 12 May 2021 14:18:00 -0700 (PDT) From: Mike Leach To: coresight@lists.linaro.org Cc: linux-arm-kernel@lists.infradead.org, mathieu.poirier@linaro.org, suzuki.poulose@arm.com, leo.yan@linaro.org, Mike Leach Subject: [RFC PATCH 0/8] coresight: syscfg: dynamic load, resource management Date: Wed, 12 May 2021 22:17:44 +0100 Message-Id: <20210512211752.4103-1-mike.leach@linaro.org> X-Mailer: git-send-email 2.17.1 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210512_141804_274250_30186AA7 X-CRM114-Status: GOOD ( 14.83 ) 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: , MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org This patchset represents the second phase of CoreSight configuration management. 1) API updated to allow dynamic load and unload of configurations and features. Dependency management between loaded sets is added. 2) New configuration and feature sets can be added using a loadable module. An example in /samples/coresight is provided to demonstrate this. 3) Resource management API is added. This allows the system to ensure that loaded configurations and features are only loaded onto devices that can support them. Further - it ensures that configurations with multiple features cannot over allocate resources. 4) configfs can be used to activate a configuration which will then be used when controlling tracing using sysfs. 5) Resource management is added to ETMv4 configurations. This allows current and future features and configurations to be defined in terms of resources used as well as registers to be programmed. Defining features in this way allows the resource management to operate correctly. The perf event parsing is also adjusted to allow the ETM resources requested on the command line (e.g. address filters, etc) to be correctly handled using resoruce management alongside the complex configurations such as autofdo. Applies to coresight/next - which is 5.13-rc1 + initial Coresight configuration patchset. To follow in future revisions / sets:- a) load of additional config and features by configfs b) ECT and CTI and other Coresight components support for configuration and features. Mike Leach (8): coresight: syscfg: Update API to allow dynamic load and unload coresight: syscfg: Update load API for config loadable modules coresight: syscfg: Example CoreSight configuration loadable module coresight: configfs: Allow configfs to activate configuration. coresight: syscfg: Add API to check and validate device resources. coresight: etm4x: syscfg: Add resource management to etm4x. coresight: etm4x: Update perf event resource handling. coresight: etm4x: Update configuration example. MAINTAINERS | 1 + .../hwtracing/coresight/coresight-cfg-afdo.c | 38 +- .../coresight/coresight-cfg-preload.c | 9 +- .../hwtracing/coresight/coresight-config.c | 71 ++- .../hwtracing/coresight/coresight-config.h | 45 +- .../hwtracing/coresight/coresight-etm4x-cfg.c | 533 ++++++++++++++++++ .../hwtracing/coresight/coresight-etm4x-cfg.h | 196 ++++++- .../coresight/coresight-etm4x-core.c | 250 +++----- .../coresight/coresight-syscfg-configfs.c | 87 +++ .../coresight/coresight-syscfg-configfs.h | 4 + .../hwtracing/coresight/coresight-syscfg.c | 390 +++++++++++-- .../hwtracing/coresight/coresight-syscfg.h | 38 +- include/linux/coresight.h | 2 + samples/Kconfig | 9 + samples/Makefile | 1 + samples/coresight/Makefile | 4 + samples/coresight/coresight-cfg-sample.c | 73 +++ 17 files changed, 1511 insertions(+), 240 deletions(-) create mode 100644 samples/coresight/Makefile create mode 100644 samples/coresight/coresight-cfg-sample.c