Received: by 2002:ab2:784b:0:b0:1fd:adc2:8405 with SMTP id m11csp236650lqp; Mon, 10 Jun 2024 02:24:16 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCXSnxTZ+YfGUV/7Hu/vQY2OHepCtPAwaernHWP/doVaoRqiouAPnEdJbNo7vPtbqDtgbcazRZ2JuzIlC/e5RZLgImkRm9WN7zmO/0VH+Q== X-Google-Smtp-Source: AGHT+IH9/RLR+AuGm9NxxfCo5cx9EQLXIAEQ7yeTRpfVN6Dvuax0Q6+kjXdxClvqBzwH/EQuCwpY X-Received: by 2002:a17:902:f54b:b0:1f7:22cf:7654 with SMTP id d9443c01a7336-1f722cf7969mr444085ad.28.1718011455955; Mon, 10 Jun 2024 02:24:15 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1718011455; cv=pass; d=google.com; s=arc-20160816; b=WjhHrWIx7+A5qghoMVJXqI0tNY9tiF9EAQeUiYBNb4ZMJ8lv5HhA7VMZZ8mVneXhmi Y7JJUE9BYLcGxBq+HxLUlGYp+b+eIn4Ly3TP0dsONL0s2FDwpOVX+RgCKVKjGpqgqt89 ylRfKAIBuWKBThuuUlU9BfnWk9X10PzU+cpwx2cqKpzlPN5LpjmP39bmVwhdYVVHIwEf Y1qwIAyHu11+g/W8+BHjyddCJcGzZgQ/CGLGRg/iVXR0ctzakj1Vu5DP3gP05gOIsyTK hbw+Cli0rM9MZTMhBmYiDhk+BrGlUrjLCo0IkuCARJNnPnfUDC94qOB5ksttZujLxH27 YjkQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:content-disposition:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:message-id:subject:cc :to:from:date; bh=fGMkQ0Xcjz4UEMWI6PBNHwqGvrcO8lY+8JuuC/wE2Us=; fh=qgMfJgvzXFQidiVGYujudC5/sUCtdt6StJkY7gN6rRQ=; b=zYy0DvP1R+FuE3d8nvtXOZz30EblTrOEidFtqBvByB2Ds6UNBctXZdxuEvCfDXM5KL WrN9qS5gotanDQoXoafE2y0XitC1nyVuOwa2A1M/WsrZoS5Xh8l8zUm697OSrDvt3toL zZtsO0lmEvlxFU4zGtHd1tQ+dmnnwlL/oUi52fzHpT60UyThqGJ3JgTq9oAy/oOwCg2J MOKGYfxIBS56tMnizvbJgsqji6mF5y7RznWRb0HiDhoJbiTJEXfmqANHAavOAInj+jp+ 8F7WBb4tzfHLK/O8+7tXZOR3elJjMnrxqjz1oDO0DSzihbCRt/6j6htsIqmKd6yNrP3j k+Jg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; arc=pass (i=1 spf=pass spfdomain=arm.com dmarc=pass fromdomain=arm.com); spf=pass (google.com: domain of linux-kernel+bounces-207932-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-207932-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id d9443c01a7336-1f6bd7d6287si41801615ad.316.2024.06.10.02.24.15 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 10 Jun 2024 02:24:15 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-207932-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) client-ip=2604:1380:45e3:2400::1; Authentication-Results: mx.google.com; arc=pass (i=1 spf=pass spfdomain=arm.com dmarc=pass fromdomain=arm.com); spf=pass (google.com: domain of linux-kernel+bounces-207932-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-207932-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com 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 sv.mirrors.kernel.org (Postfix) with ESMTPS id EF150287369 for ; Mon, 10 Jun 2024 09:23:41 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 966EF757EF; Mon, 10 Jun 2024 09:23:28 +0000 (UTC) Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by smtp.subspace.kernel.org (Postfix) with ESMTP id C1EC974054; Mon, 10 Jun 2024 09:23:25 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=217.140.110.172 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718011408; cv=none; b=db3OXt+PfAVhpndG6aEXNNRpKow5RM63h6KeM1DuBzOhvzhNxtWBO8ybBo8CFDlx/6+kFHmH41FekWBLRuKSfuVBmFGaOsmUYnadTDiFT1uY+gDmFsRdYkcLybpX133hfDzj4NRATZ4awvKEqV3ypWkS4HfocjibDJZHv7OBJ4A= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718011408; c=relaxed/simple; bh=ycXPxrHQqWs+PsV8fD314WdCfm1zb1kWuAA1Sks+2ho=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=dnBRKX4AwcaDurCjjJ+jjXyTY8XXuSNPT66n8MHFZPbgcn3i0ry+9pWi5r8DeqEZgsuVwnST8OuQMKeFgRgIdcX+I3U+NI0QVRdrt+O7wrdWjLVqFa9aUvyvERW+bKu6Jx1fphOm0nSxBeBTSCDvggQFoyNpmy4w5X6+yzJBXyE= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=arm.com; spf=pass smtp.mailfrom=arm.com; arc=none smtp.client-ip=217.140.110.172 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=arm.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=arm.com 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 8FC9812FC; Mon, 10 Jun 2024 02:23:49 -0700 (PDT) Received: from J2N7QTR9R3 (usa-sjc-imap-foss1.foss.arm.com [10.121.207.14]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id AE4693F73B; Mon, 10 Jun 2024 02:23:21 -0700 (PDT) Date: Mon, 10 Jun 2024 10:23:18 +0100 From: Mark Rutland To: "Rob Herring (Arm)" Cc: Russell King , Peter Zijlstra , Ingo Molnar , Arnaldo Carvalho de Melo , Namhyung Kim , Alexander Shishkin , Jiri Olsa , Ian Rogers , Adrian Hunter , Will Deacon , Marc Zyngier , Oliver Upton , James Morse , Suzuki K Poulose , Zenghui Yu , Catalin Marinas , linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-perf-users@vger.kernel.org, kvmarm@lists.linux.dev Subject: Re: [PATCH 1/9] perf/arm: Move 32-bit PMU drivers to drivers/perf/ Message-ID: References: <20240607-arm-pmu-3-9-icntr-v1-0-c7bd2dceff3b@kernel.org> <20240607-arm-pmu-3-9-icntr-v1-1-c7bd2dceff3b@kernel.org> 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=us-ascii Content-Disposition: inline In-Reply-To: <20240607-arm-pmu-3-9-icntr-v1-1-c7bd2dceff3b@kernel.org> On Fri, Jun 07, 2024 at 02:31:26PM -0600, Rob Herring (Arm) wrote: > 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) Acked-by: Mark Rutland Mark. > --- > 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 > >