Received: by 2002:ab2:6309:0:b0:1fb:d597:ff75 with SMTP id s9csp1284925lqt; Fri, 7 Jun 2024 13:32:19 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCUn0I0Nv3daegJzEGu4s258WJNXieJhfyAgIdoB3+BAtG/q09B0cjsV4tdRLr1X3fjbvmZRlXVtF0zi8O8vdDc4KYsy3QAuZtFfLAg0hA== X-Google-Smtp-Source: AGHT+IEYe9u33rAhOFoiDE8DiPBXj5+eBIJeybi9llUZ/KirS6balvMZAIelg6zLuJpb+IDmp4ak X-Received: by 2002:a05:6512:203:b0:52b:d909:17c4 with SMTP id 2adb3069b0e04-52bd9091b26mr671561e87.65.1717792339492; Fri, 07 Jun 2024 13:32:19 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1717792339; cv=pass; d=google.com; s=arc-20160816; b=tfzSfMPwYAdCEGzFrXPVs7M8HPWYi8eL61VeFbO7ILlDkIMgE1WtNkjkhwGYng6QxN Rnx+7+tcx8xyyWfkzICP5+gbNPGqIDgmnp9ryyEg9RJmVQRF+eOkL+TjYUZYMLbVsgCJ 5ZIb4yGLBTX3IvDZO1S625oCCy3zJWut/Z6y9RETLBl8mAVFhJWtgL9BkXTBPulJjdRo +Jw7pkLeQhsZUr0FZ7nXLuQX0L+np9EaYxnvxnAnRsY7fjp9sklOxogXyMwB1GJg0xly Pw3nCWEPrlCaYNirgX1HIqcrkjz1YobvHFAVKxC053OndwlLepomZfKhzC4nMdd1vL9k +bJQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:list-unsubscribe:list-subscribe:list-id:precedence :subject:date:from:dkim-signature; bh=ra9WRhOWAhqEWsxMNGbv9/E29j9Pu3QbUyhyDC90J7s=; fh=7MWtQIrhu8/8z5W30BSUbJmbB5Xoil/A+Q0kLnK8lig=; b=OiCsNWY4lzWxu12xbVvsTeNxr8t/q5859bJpLef05I0kViTocZAtpaF//4v/cU/y/m o+fDRjkpI92CpcBQi/mPD7rM82s3FBPc/ovhPhpM0wvV5BElvhcL1Ki9iICHbfdDNJnq G6rGcXg6AqvcvWMuBuInN+5FR2HtlQhVO54ZP+6O5LQRnps2RjS7QE3NKRYWiJP/bq8B Sk/G16sSbL1GnXzbOmiVcyQxu1Fv2iSP0gbOo35ZW7lffiExvFDOY9POmJ5czTnejB/t DpQuH3FTQLZjuRijffrIc6V+lsLcA1MszFGhturaJtEEIXh2Y9k9Qu7ZBFMIqh35frci lyWQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=hbCjfBcM; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-206714-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-206714-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id a640c23a62f3a-a6c8074bb6csi218353166b.1039.2024.06.07.13.32.19 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 07 Jun 2024 13:32:19 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-206714-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) client-ip=147.75.80.249; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=hbCjfBcM; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-206714-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-206714-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by am.mirrors.kernel.org (Postfix) with ESMTPS id 0A44E1F23809 for ; Fri, 7 Jun 2024 20:32:19 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 7E679154429; Fri, 7 Jun 2024 20:32:05 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="hbCjfBcM" Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 826B31514F9; Fri, 7 Jun 2024 20:32:04 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717792324; cv=none; b=e1or98+c395Hk5B3UiU1ENAvtO8sJ8daAW4trsTUQmLgqGqiz+Kn0Tl+QJYIxP73yZxM/47e2grtBVEvZZMZj2dHExagXgUHoCgt4hZJFiAinmDlfUxd6nHT+XJVifGkQJySAiE9TbSnum3YuG4GFaTrC3eJ5nIo4F5cYE7t228= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717792324; c=relaxed/simple; bh=fgF8NeangU+IYDXxVWYK3CVB9PI5gI3tRv7iErEHfpY=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=L2+X7SZIR5qaPIExc6z6tX5Nezme43/BF276mbjQrFT90lRp/QrJePAV8+uMo2fyymUJZ/NuGvfccTbagqUNHyl067v0vQAfeppf6qbUdLihog8+98/LaV8KHuQygtE6Nvt6zvCgmaVmuCljNE0RmgjIxP3xQztO4Dn3urbcvps= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=hbCjfBcM; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 2B66EC2BBFC; Fri, 7 Jun 2024 20:32:04 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1717792324; bh=fgF8NeangU+IYDXxVWYK3CVB9PI5gI3tRv7iErEHfpY=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=hbCjfBcM3eIR2Mal8CfRaYjzFSXUf6/Q7WYuXt5+rlxCh3OhtrAcB/W7haHwswniR WPaG6cXPDXUrbnFoYN80MYkqsNEvOC3vAAe61v9eRCaOZEn4xJYKEJ9TnF/T+QbfVA x+4hoeaAg2vOJ19VydY4g+A6DsCQWzYhBw+TvlDMzWrBvtZpvr+hdQ9kKX9xPgwBev DvPPIOupbR5mAC5+r4aPHnJnCSXB5zGqBYD6+ciqcHKME26/hL0Xcc9GppC1x2eCwR X7Wke+Gs5eN6LbU1ZxEOcW4pUEa7kfp2ix1ibcVKLge8q/eneo/QQjJzHdylDmMrUo CmUsL4H07aPIg== From: "Rob Herring (Arm)" Date: Fri, 07 Jun 2024 14:31:26 -0600 Subject: [PATCH 1/9] perf/arm: Move 32-bit PMU drivers to drivers/perf/ Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Message-Id: <20240607-arm-pmu-3-9-icntr-v1-1-c7bd2dceff3b@kernel.org> References: <20240607-arm-pmu-3-9-icntr-v1-0-c7bd2dceff3b@kernel.org> In-Reply-To: <20240607-arm-pmu-3-9-icntr-v1-0-c7bd2dceff3b@kernel.org> To: Russell King , Peter Zijlstra , Ingo Molnar , Arnaldo Carvalho de Melo , Namhyung Kim , Mark Rutland , Alexander Shishkin , Jiri Olsa , Ian Rogers , Adrian Hunter , Will Deacon , Marc Zyngier , Oliver Upton , James Morse , Suzuki K Poulose , Zenghui Yu , Catalin Marinas Cc: linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-perf-users@vger.kernel.org, kvmarm@lists.linux.dev X-Mailer: b4 0.14-dev It is preferred to put drivers under drivers/ rather than under arch/. The PMU drivers also depend on arm_pmu.c, so it's better to place them all together. Signed-off-by: Rob Herring (Arm) --- arch/arm/kernel/Makefile | 2 -- drivers/perf/Kconfig | 12 ++++++++++++ drivers/perf/Makefile | 3 +++ arch/arm/kernel/perf_event_v6.c => drivers/perf/arm_v6_pmu.c | 3 --- arch/arm/kernel/perf_event_v7.c => drivers/perf/arm_v7_pmu.c | 3 --- .../perf_event_xscale.c => drivers/perf/arm_xscale_pmu.c | 3 --- 6 files changed, 15 insertions(+), 11 deletions(-) diff --git a/arch/arm/kernel/Makefile b/arch/arm/kernel/Makefile index 89a77e3f51d2..aaae31b8c4a5 100644 --- a/arch/arm/kernel/Makefile +++ b/arch/arm/kernel/Makefile @@ -78,8 +78,6 @@ obj-$(CONFIG_CPU_XSC3) += xscale-cp0.o obj-$(CONFIG_CPU_MOHAWK) += xscale-cp0.o obj-$(CONFIG_IWMMXT) += iwmmxt.o obj-$(CONFIG_PERF_EVENTS) += perf_regs.o perf_callchain.o -obj-$(CONFIG_HW_PERF_EVENTS) += perf_event_xscale.o perf_event_v6.o \ - perf_event_v7.o AFLAGS_iwmmxt.o := -Wa,-mcpu=iwmmxt obj-$(CONFIG_ARM_CPU_TOPOLOGY) += topology.o obj-$(CONFIG_VDSO) += vdso.o diff --git a/drivers/perf/Kconfig b/drivers/perf/Kconfig index 7526a9e714fa..aa9530b4064f 100644 --- a/drivers/perf/Kconfig +++ b/drivers/perf/Kconfig @@ -56,6 +56,18 @@ config ARM_PMU Say y if you want to use CPU performance monitors on ARM-based systems. +config ARM_V6_PMU + depends on ARM_PMU && (CPU_V6 || CPU_V6K) + def_bool y + +config ARM_V7_PMU + depends on ARM_PMU && CPU_V7 + def_bool y + +config ARM_XSCALE_PMU + depends on ARM_PMU && CPU_XSCALE + def_bool y + config RISCV_PMU depends on RISCV bool "RISC-V PMU framework" diff --git a/drivers/perf/Makefile b/drivers/perf/Makefile index 29b1c28203ef..d43df81d52f7 100644 --- a/drivers/perf/Makefile +++ b/drivers/perf/Makefile @@ -6,6 +6,9 @@ obj-$(CONFIG_ARM_DSU_PMU) += arm_dsu_pmu.o obj-$(CONFIG_ARM_PMU) += arm_pmu.o arm_pmu_platform.o obj-$(CONFIG_ARM_PMU_ACPI) += arm_pmu_acpi.o obj-$(CONFIG_ARM_PMUV3) += arm_pmuv3.o +obj-$(CONFIG_ARM_V6_PMU) += arm_v6_pmu.o +obj-$(CONFIG_ARM_V7_PMU) += arm_v7_pmu.o +obj-$(CONFIG_ARM_XSCALE_PMU) += arm_xscale_pmu.o obj-$(CONFIG_ARM_SMMU_V3_PMU) += arm_smmuv3_pmu.o obj-$(CONFIG_FSL_IMX8_DDR_PMU) += fsl_imx8_ddr_perf.o obj-$(CONFIG_FSL_IMX9_DDR_PMU) += fsl_imx9_ddr_perf.o diff --git a/arch/arm/kernel/perf_event_v6.c b/drivers/perf/arm_v6_pmu.c similarity index 99% rename from arch/arm/kernel/perf_event_v6.c rename to drivers/perf/arm_v6_pmu.c index d9fd53841591..f7593843bb85 100644 --- a/arch/arm/kernel/perf_event_v6.c +++ b/drivers/perf/arm_v6_pmu.c @@ -31,8 +31,6 @@ * enable the interrupt. */ -#if defined(CONFIG_CPU_V6) || defined(CONFIG_CPU_V6K) - #include #include @@ -445,4 +443,3 @@ static struct platform_driver armv6_pmu_driver = { }; builtin_platform_driver(armv6_pmu_driver); -#endif /* CONFIG_CPU_V6 || CONFIG_CPU_V6K */ diff --git a/arch/arm/kernel/perf_event_v7.c b/drivers/perf/arm_v7_pmu.c similarity index 99% rename from arch/arm/kernel/perf_event_v7.c rename to drivers/perf/arm_v7_pmu.c index a3322e2b3ea4..fdd936fbd188 100644 --- a/arch/arm/kernel/perf_event_v7.c +++ b/drivers/perf/arm_v7_pmu.c @@ -17,8 +17,6 @@ * counter and all 4 performance counters together can be reset separately. */ -#ifdef CONFIG_CPU_V7 - #include #include #include @@ -2002,4 +2000,3 @@ static struct platform_driver armv7_pmu_driver = { }; builtin_platform_driver(armv7_pmu_driver); -#endif /* CONFIG_CPU_V7 */ diff --git a/arch/arm/kernel/perf_event_xscale.c b/drivers/perf/arm_xscale_pmu.c similarity index 99% rename from arch/arm/kernel/perf_event_xscale.c rename to drivers/perf/arm_xscale_pmu.c index 7a2ba1c689a7..3d8b72d6b37f 100644 --- a/arch/arm/kernel/perf_event_xscale.c +++ b/drivers/perf/arm_xscale_pmu.c @@ -13,8 +13,6 @@ * PMU structures. */ -#ifdef CONFIG_CPU_XSCALE - #include #include @@ -745,4 +743,3 @@ static struct platform_driver xscale_pmu_driver = { }; builtin_platform_driver(xscale_pmu_driver); -#endif /* CONFIG_CPU_XSCALE */ -- 2.43.0