From patchwork Wed Nov 17 15:38:19 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alexandru Elisei X-Patchwork-Id: 12692947 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id C4417C433F5 for ; Wed, 17 Nov 2021 15:46:20 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (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 8FEE460EB4 for ; Wed, 17 Nov 2021 15:46:20 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 8FEE460EB4 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=arm.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:To:From:Reply-To:Cc:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=MUMRzRnybWKVDUFaV8maV9G4gWYDLs7CqtRfEk017z0=; b=WC/EN86rdZKlpb vt7pEJ129UZDV5tDq5LL5CYbhrQEG0Lbzflo9rUgFq1aMIx8mrr+MmVAYqVTdI9zI4iWUWcFqVyY3 kpU0KU3kzqFVF5PSB9YkSkl5ZbBJ2fRdUypmtVOvPcGQjTM6EDMpItcfwj9hZV0Iv8L/i1qucM+FL PhxzgkvXde6etNMsp2ENRM7MQcxRYC8Wvv8NR7FqKKmlrfWO4oTPuAnmMXjyVlHWNy8ZEkOLDWDpZ +AMZobDIRKQjh5EGtRIJhRcUWXaVAqdSyDxhGAoaz/znQEhV9OlUeq/w7YbQMTXYb2MMzM8L8THri bULmgVyE1rLuSVfG7g0Q==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1mnN6z-005TWD-N2; Wed, 17 Nov 2021 15:44:38 +0000 Received: from foss.arm.com ([217.140.110.172]) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1mnN04-005Q42-VE for linux-arm-kernel@lists.infradead.org; Wed, 17 Nov 2021 15:37:30 +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 E1FDAED1; Wed, 17 Nov 2021 07:37:27 -0800 (PST) Received: from monolith.localdoman (unknown [172.31.20.19]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 4D74B3F5A1; Wed, 17 Nov 2021 07:37:26 -0800 (PST) From: Alexandru Elisei To: maz@kernel.org, james.morse@arm.com, suzuki.poulose@arm.com, linux-arm-kernel@lists.infradead.org, kvmarm@lists.cs.columbia.edu, will@kernel.org, mark.rutland@arm.com Subject: [RFC PATCH v5 15/38] perf: arm_spe_pmu: Move struct arm_spe_pmu to a separate header file Date: Wed, 17 Nov 2021 15:38:19 +0000 Message-Id: <20211117153842.302159-16-alexandru.elisei@arm.com> X-Mailer: git-send-email 2.33.1 In-Reply-To: <20211117153842.302159-1-alexandru.elisei@arm.com> References: <20211117153842.302159-1-alexandru.elisei@arm.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20211117_073729_142185_75AD3440 X-CRM114-Status: GOOD ( 13.74 ) 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: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org KVM will soon want to make use of struct arm_spe_pmu, move it to a separate header where it will be easily accessible. This is a straightforward move and functionality should not be impacted. CC: Will Deacon Signed-off-by: Alexandru Elisei Signed-off-by: Calvin Owens --- drivers/perf/arm_spe_pmu.c | 29 +------------------ include/linux/perf/arm_spe_pmu.h | 49 ++++++++++++++++++++++++++++++++ 2 files changed, 50 insertions(+), 28 deletions(-) create mode 100644 include/linux/perf/arm_spe_pmu.h diff --git a/drivers/perf/arm_spe_pmu.c b/drivers/perf/arm_spe_pmu.c index d44bcc29d99c..ccb92c182527 100644 --- a/drivers/perf/arm_spe_pmu.c +++ b/drivers/perf/arm_spe_pmu.c @@ -27,7 +27,7 @@ #include #include #include -#include +#include #include #include #include @@ -47,33 +47,6 @@ struct arm_spe_pmu_buf { void *base; }; -struct arm_spe_pmu { - struct pmu pmu; - struct platform_device *pdev; - cpumask_t supported_cpus; - struct hlist_node hotplug_node; - - int irq; /* PPI */ - u16 pmsver; - u16 min_period; - u16 counter_sz; - -#define SPE_PMU_FEAT_FILT_EVT (1UL << 0) -#define SPE_PMU_FEAT_FILT_TYP (1UL << 1) -#define SPE_PMU_FEAT_FILT_LAT (1UL << 2) -#define SPE_PMU_FEAT_ARCH_INST (1UL << 3) -#define SPE_PMU_FEAT_LDS (1UL << 4) -#define SPE_PMU_FEAT_ERND (1UL << 5) -#define SPE_PMU_FEAT_DEV_PROBED (1UL << 63) - u64 features; - - u16 max_record_sz; - u16 align; - struct perf_output_handle __percpu *handle; -}; - -#define to_spe_pmu(p) (container_of(p, struct arm_spe_pmu, pmu)) - /* Convert a free-running index from perf into an SPE buffer offset */ #define PERF_IDX2OFF(idx, buf) ((idx) % ((buf)->nr_pages << PAGE_SHIFT)) diff --git a/include/linux/perf/arm_spe_pmu.h b/include/linux/perf/arm_spe_pmu.h new file mode 100644 index 000000000000..7711e59c5727 --- /dev/null +++ b/include/linux/perf/arm_spe_pmu.h @@ -0,0 +1,49 @@ +/* SPDX-License-Identifier: GPL-2.0-only */ +/* + * Split from from drivers/perf/arm_spe_pmu.c. + * + * Copyright (C) 2021 ARM Limited + */ + +#ifndef __ARM_SPE_PMU_H__ +#define __ARM_SPE_PMU_H__ + +#include +#include +#include +#include + +#ifdef CONFIG_ARM_SPE_PMU + +struct arm_spe_pmu { + struct pmu pmu; + struct platform_device *pdev; + cpumask_t supported_cpus; + struct hlist_node hotplug_node; + + int irq; /* PPI */ + u16 pmsver; + u16 min_period; + u16 counter_sz; + +#define SPE_PMU_FEAT_FILT_EVT (1UL << 0) +#define SPE_PMU_FEAT_FILT_TYP (1UL << 1) +#define SPE_PMU_FEAT_FILT_LAT (1UL << 2) +#define SPE_PMU_FEAT_ARCH_INST (1UL << 3) +#define SPE_PMU_FEAT_LDS (1UL << 4) +#define SPE_PMU_FEAT_ERND (1UL << 5) +#define SPE_PMU_FEAT_DEV_PROBED (1UL << 63) + u64 features; + + u16 max_record_sz; + u16 align; + struct perf_output_handle __percpu *handle; +}; + +#define to_spe_pmu(p) (container_of(p, struct arm_spe_pmu, pmu)) + +#define ARMV8_SPE_PDEV_NAME "arm,spe-v1" + +#endif /* CONFIG_ARM_SPE_PMU */ + +#endif /* __ARM_SPE_PMU_H__ */