mbox series

[v6,0/2] perf: ARM CoreSight PMU support

Message ID 20220930023443.9463-1-bwicaksono@nvidia.com (mailing list archive)
Headers show
Series perf: ARM CoreSight PMU support | expand

Message

Besar Wicaksono Sept. 30, 2022, 2:34 a.m. UTC
Add driver support for ARM CoreSight PMU device and event attributes for NVIDIA
implementation. The code is based on ARM Coresight PMU architecture and ACPI ARM
Performance Monitoring Unit table (APMT) specification below:
 * ARM Coresight PMU:
        https://developer.arm.com/documentation/ihi0091/latest
 * APMT: https://developer.arm.com/documentation/den0117/latest

The patchset applies on top of
  https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git
  master next-20220524

For APMT support, please see patchset: https://lkml.org/lkml/2022/4/19/1395 

Changes from v5:
 * Default get_event/format_attrs callback now returns copy of default array.
Thanks to suzuki.poulose@arm.com for the review comments.
v5: https://lore.kernel.org/linux-arm-kernel/20220928201830.45637-1-bwicaksono@nvidia.com/

Changes from v4:
 * Fix code formatting
 * Add timeout to read register function with high-low-high sequence
 * Add NO_INTERRUPT capability on PMU that does not have IRQ
 * Fix the name of NVIDIA PMUs
 * Drop filter attribute for NVLink-C2C PMUs
 * Added Reviewed/Acked-by from Suzuki
Thanks to suzuki.poulose@arm.com and will@kernel.org for the review comments.
v4: https://lore.kernel.org/linux-arm-kernel/20220814182351.8861-1-bwicaksono@nvidia.com/

Changes from v3:
 * Driver is now probing "arm-cs-arch-pmu" device.
 * The driver files, directory, functions are renamed with "arm_cspmu" prefix.
 * Use Kconfig ARM_CORESIGHT_PMU_ARCH_SYSTEM_PMU.
 * Add kernel doc for NVIDIA Uncore PMU.
 * Use GENMASK and FIELD_GET macros everywhere.
Thanks to suzuki.poulose@arm.com and will@kernel.org for the review comments.
v3: https://lore.kernel.org/linux-arm-kernel/20220621055035.31766-1-bwicaksono@nvidia.com/

Changes from v2:
 * Driver is now probing "arm-system-pmu" device.
 * Change default PMU naming to "arm_<APMT node type>_pmu".
 * Add implementor ops to generate custom name.
Thanks to suzuki.poulose@arm.com for the review comments.
v2: https://lore.kernel.org/linux-arm-kernel/20220515163044.50055-1-bwicaksono@nvidia.com/

Changes from v1:
 * Remove CPU arch dependency.
 * Remove 32-bit read/write helper function and just use read/writel.
 * Add .is_visible into event attribute to filter out cycle counter event.
 * Update pmiidr matching.
 * Remove read-modify-write on PMCR since the driver only writes to PMCR.E.
 * Assign default cycle event outside the 32-bit PMEVTYPER range.
 * Rework the active event and used counter tracking.
Thanks to robin.murphy@arm.com for the review comments.
v1: https://lore.kernel.org/linux-arm-kernel/20220509002810.12412-1-bwicaksono@nvidia.com/

Besar Wicaksono (2):
  perf: arm_cspmu: Add support for ARM CoreSight PMU driver
  perf: arm_cspmu: Add support for NVIDIA SCF and MCF attribute

 Documentation/admin-guide/perf/index.rst      |    1 +
 Documentation/admin-guide/perf/nvidia-pmu.rst |  299 ++++
 arch/arm64/configs/defconfig                  |    1 +
 drivers/perf/Kconfig                          |    2 +
 drivers/perf/Makefile                         |    1 +
 drivers/perf/arm_cspmu/Kconfig                |   13 +
 drivers/perf/arm_cspmu/Makefile               |    7 +
 drivers/perf/arm_cspmu/arm_cspmu.c            | 1301 +++++++++++++++++
 drivers/perf/arm_cspmu/arm_cspmu.h            |  151 ++
 drivers/perf/arm_cspmu/nvidia_cspmu.c         |  398 +++++
 drivers/perf/arm_cspmu/nvidia_cspmu.h         |   17 +
 11 files changed, 2191 insertions(+)
 create mode 100644 Documentation/admin-guide/perf/nvidia-pmu.rst
 create mode 100644 drivers/perf/arm_cspmu/Kconfig
 create mode 100644 drivers/perf/arm_cspmu/Makefile
 create mode 100644 drivers/perf/arm_cspmu/arm_cspmu.c
 create mode 100644 drivers/perf/arm_cspmu/arm_cspmu.h
 create mode 100644 drivers/perf/arm_cspmu/nvidia_cspmu.c
 create mode 100644 drivers/perf/arm_cspmu/nvidia_cspmu.h


base-commit: 09ce5091ff971cdbfd67ad84dc561ea27f10d67a

Comments

Will Deacon Nov. 7, 2022, 3:53 p.m. UTC | #1
On Thu, Sep 29, 2022 at 09:34:41PM -0500, Besar Wicaksono wrote:
> Add driver support for ARM CoreSight PMU device and event attributes for NVIDIA
> implementation. The code is based on ARM Coresight PMU architecture and ACPI ARM
> Performance Monitoring Unit table (APMT) specification below:
>  * ARM Coresight PMU:
>         https://developer.arm.com/documentation/ihi0091/latest
>  * APMT: https://developer.arm.com/documentation/den0117/latest
> 
> The patchset applies on top of
>   https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git
>   master next-20220524
> 
> For APMT support, please see patchset: https://lkml.org/lkml/2022/4/19/1395 
> 
> Changes from v5:
>  * Default get_event/format_attrs callback now returns copy of default array.
> Thanks to suzuki.poulose@arm.com for the review comments.
> v5: https://lore.kernel.org/linux-arm-kernel/20220928201830.45637-1-bwicaksono@nvidia.com/

These patches no longer apply. Please can you rebase onto -rc4 and drop the
defconfig change from the first patch?

Thanks,

Will
Besar Wicaksono Nov. 7, 2022, 5:11 p.m. UTC | #2
Hi Will,

> -----Original Message-----
> From: Will Deacon <will@kernel.org>
> Sent: Monday, November 7, 2022 9:53 AM
> To: Besar Wicaksono <bwicaksono@nvidia.com>
> Cc: suzuki.poulose@arm.com; robin.murphy@arm.com;
> catalin.marinas@arm.com; mark.rutland@arm.com; linux-arm-
> kernel@lists.infradead.org; linux-kernel@vger.kernel.org; linux-
> tegra@vger.kernel.org; sudeep.holla@arm.com;
> thanu.rangarajan@arm.com; Michael.Williams@arm.com; Thierry Reding
> <treding@nvidia.com>; Jonathan Hunter <jonathanh@nvidia.com>; Vikram
> Sethi <vsethi@nvidia.com>; mathieu.poirier@linaro.org;
> mike.leach@linaro.org; leo.yan@linaro.org
> Subject: Re: [PATCH v6 0/2] perf: ARM CoreSight PMU support
> 
> External email: Use caution opening links or attachments
> 
> 
> On Thu, Sep 29, 2022 at 09:34:41PM -0500, Besar Wicaksono wrote:
> > Add driver support for ARM CoreSight PMU device and event attributes for
> NVIDIA
> > implementation. The code is based on ARM Coresight PMU architecture
> and ACPI ARM
> > Performance Monitoring Unit table (APMT) specification below:
> >  * ARM Coresight PMU:
> >         https://developer.arm.com/documentation/ihi0091/latest
> >  * APMT: https://developer.arm.com/documentation/den0117/latest
> >
> > The patchset applies on top of
> >   https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git
> >   master next-20220524
> >
> > For APMT support, please see patchset:
> https://lkml.org/lkml/2022/4/19/1395
> >
> > Changes from v5:
> >  * Default get_event/format_attrs callback now returns copy of default
> array.
> > Thanks to suzuki.poulose@arm.com for the review comments.
> > v5: https://lore.kernel.org/linux-arm-kernel/20220928201830.45637-1-
> bwicaksono@nvidia.com/
> 
> These patches no longer apply. Please can you rebase onto -rc4 and drop the
> defconfig change from the first patch?

Why does the defconfig change need to be dropped ?
And sure, I will rebase to 6.1 rc4.

Thanks,
Besar

> 
> Thanks,
> 
> Will
Will Deacon Nov. 7, 2022, 6:01 p.m. UTC | #3
On Mon, Nov 07, 2022 at 05:11:07PM +0000, Besar Wicaksono wrote:
> Hi Will,
> 
> > -----Original Message-----
> > From: Will Deacon <will@kernel.org>
> > Sent: Monday, November 7, 2022 9:53 AM
> > To: Besar Wicaksono <bwicaksono@nvidia.com>
> > Cc: suzuki.poulose@arm.com; robin.murphy@arm.com;
> > catalin.marinas@arm.com; mark.rutland@arm.com; linux-arm-
> > kernel@lists.infradead.org; linux-kernel@vger.kernel.org; linux-
> > tegra@vger.kernel.org; sudeep.holla@arm.com;
> > thanu.rangarajan@arm.com; Michael.Williams@arm.com; Thierry Reding
> > <treding@nvidia.com>; Jonathan Hunter <jonathanh@nvidia.com>; Vikram
> > Sethi <vsethi@nvidia.com>; mathieu.poirier@linaro.org;
> > mike.leach@linaro.org; leo.yan@linaro.org
> > Subject: Re: [PATCH v6 0/2] perf: ARM CoreSight PMU support
> > 
> > External email: Use caution opening links or attachments
> > 
> > 
> > On Thu, Sep 29, 2022 at 09:34:41PM -0500, Besar Wicaksono wrote:
> > > Add driver support for ARM CoreSight PMU device and event attributes for
> > NVIDIA
> > > implementation. The code is based on ARM Coresight PMU architecture
> > and ACPI ARM
> > > Performance Monitoring Unit table (APMT) specification below:
> > >  * ARM Coresight PMU:
> > >         https://developer.arm.com/documentation/ihi0091/latest
> > >  * APMT: https://developer.arm.com/documentation/den0117/latest
> > >
> > > The patchset applies on top of
> > >   https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git
> > >   master next-20220524
> > >
> > > For APMT support, please see patchset:
> > https://lkml.org/lkml/2022/4/19/1395
> > >
> > > Changes from v5:
> > >  * Default get_event/format_attrs callback now returns copy of default
> > array.
> > > Thanks to suzuki.poulose@arm.com for the review comments.
> > > v5: https://lore.kernel.org/linux-arm-kernel/20220928201830.45637-1-
> > bwicaksono@nvidia.com/
> > 
> > These patches no longer apply. Please can you rebase onto -rc4 and drop the
> > defconfig change from the first patch?
> 
> Why does the defconfig change need to be dropped ?

Oh, just because that file is a big source of conflicts so I'd prefer to
keep defconfig changes separate from patches which add new functionality.

Will
Besar Wicaksono Nov. 11, 2022, 11:48 p.m. UTC | #4
Hi Will,

> -----Original Message-----
> From: Will Deacon <will@kernel.org>
> Sent: Monday, November 7, 2022 12:01 PM
> To: Besar Wicaksono <bwicaksono@nvidia.com>
> Cc: suzuki.poulose@arm.com; robin.murphy@arm.com;
> catalin.marinas@arm.com; mark.rutland@arm.com; linux-arm-
> kernel@lists.infradead.org; linux-kernel@vger.kernel.org; linux-
> tegra@vger.kernel.org; sudeep.holla@arm.com;
> thanu.rangarajan@arm.com; Michael.Williams@arm.com; Thierry Reding
> <treding@nvidia.com>; Jonathan Hunter <jonathanh@nvidia.com>; Vikram
> Sethi <vsethi@nvidia.com>; mathieu.poirier@linaro.org;
> mike.leach@linaro.org; leo.yan@linaro.org
> Subject: Re: [PATCH v6 0/2] perf: ARM CoreSight PMU support
> 
> External email: Use caution opening links or attachments
> 
> 
> On Mon, Nov 07, 2022 at 05:11:07PM +0000, Besar Wicaksono wrote:
> > Hi Will,
> >
> > > -----Original Message-----
> > > From: Will Deacon <will@kernel.org>
> > > Sent: Monday, November 7, 2022 9:53 AM
> > > To: Besar Wicaksono <bwicaksono@nvidia.com>
> > > Cc: suzuki.poulose@arm.com; robin.murphy@arm.com;
> > > catalin.marinas@arm.com; mark.rutland@arm.com; linux-arm-
> > > kernel@lists.infradead.org; linux-kernel@vger.kernel.org; linux-
> > > tegra@vger.kernel.org; sudeep.holla@arm.com;
> > > thanu.rangarajan@arm.com; Michael.Williams@arm.com; Thierry Reding
> > > <treding@nvidia.com>; Jonathan Hunter <jonathanh@nvidia.com>;
> Vikram
> > > Sethi <vsethi@nvidia.com>; mathieu.poirier@linaro.org;
> > > mike.leach@linaro.org; leo.yan@linaro.org
> > > Subject: Re: [PATCH v6 0/2] perf: ARM CoreSight PMU support
> > >
> > > External email: Use caution opening links or attachments
> > >
> > >
> > > On Thu, Sep 29, 2022 at 09:34:41PM -0500, Besar Wicaksono wrote:
> > > > Add driver support for ARM CoreSight PMU device and event attributes
> for
> > > NVIDIA
> > > > implementation. The code is based on ARM Coresight PMU architecture
> > > and ACPI ARM
> > > > Performance Monitoring Unit table (APMT) specification below:
> > > >  * ARM Coresight PMU:
> > > >         https://developer.arm.com/documentation/ihi0091/latest
> > > >  * APMT: https://developer.arm.com/documentation/den0117/latest
> > > >
> > > > The patchset applies on top of
> > > >   https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git
> > > >   master next-20220524
> > > >
> > > > For APMT support, please see patchset:
> > > https://lkml.org/lkml/2022/4/19/1395
> > > >
> > > > Changes from v5:
> > > >  * Default get_event/format_attrs callback now returns copy of default
> > > array.
> > > > Thanks to suzuki.poulose@arm.com for the review comments.
> > > > v5: https://lore.kernel.org/linux-arm-kernel/20220928201830.45637-1-
> > > bwicaksono@nvidia.com/
> > >
> > > These patches no longer apply. Please can you rebase onto -rc4 and drop
> the
> > > defconfig change from the first patch?
> >
> > Why does the defconfig change need to be dropped ?
> 
> Oh, just because that file is a big source of conflicts so I'd prefer to
> keep defconfig changes separate from patches which add new functionality.
> 

Sorry for the delay. I have sent v7 patchset with the rebase to 6.1-rc4.
Link: https://lore.kernel.org/linux-arm-kernel/20221111222330.48602-1-bwicaksono@nvidia.com/
Could you please try again ?

Regards,
Besar

> Will