Linux Perf Users
 help / color / mirror / Atom feed
From: sashiko-bot@kernel.org
To: "Amir Ayupov" <aaupov@fb.com>
Cc: linux-perf-users@vger.kernel.org
Subject: Re: [PATCH v5 5/7] perf: arm_pmuv3: Add pmuv3_event_implemented()
Date: Fri, 20 Nov 2026 15:39:59 +0000	[thread overview]
Message-ID: <sashiko-outbox-225474@kernel.org> (raw)
In-Reply-To: <a0472c58f855a9bd358f7faf8e88e44207c90fc4.1795182850.git.aaupov@fb.com>

Thank you for your contribution! Sashiko AI review found 1 potential
issue to consider:
- [Medium] perf: arm_pmu: build failure on 32-bit ARM without
  CONFIG_CPU_CP15
--

commit 35316b1d7277cb0d1201241837c2de25d95ad9c1
Author: Amir Ayupov <aaupov@fb.com>

perf: arm_pmuv3: Add pmuv3_event_implemented()

This commit adds pmuv3_event_implemented() to arch/arm64/include/asm/arm_pmuv3.h
to query whether the local CPU's PMU implements a common event via PMCEID0/1,
and moves ARMV8_PMUV3_MAX_COMMON_EVENTS and ARMV8_PMUV3_EXT_COMMON_EVENT_BASE
from include/linux/perf/arm_pmu.h to include/linux/perf/arm_pmuv3.h.

> diff --git a/include/linux/perf/arm_pmu.h b/include/linux/perf/arm_pmu.h
> index 02d2c7f45b527..a90867c9774c7 100644
> --- a/include/linux/perf/arm_pmu.h
> +++ b/include/linux/perf/arm_pmu.h
> @@ -10,6 +10,7 @@
>  
>  #include <linux/interrupt.h>
>  #include <linux/perf_event.h>
> +#include <linux/perf/arm_pmuv3.h>
>  #include <linux/platform_device.h>
>  #include <linux/sysfs.h>
>  #include <asm/cputype.h>

[Severity: Medium]
Does unconditionally including linux/perf/arm_pmuv3.h here break 32-bit
ARM builds when CONFIG_CPU_CP15 is disabled (for example on
CONFIG_CPU_V7M) and CONFIG_ARM_PMU is enabled?

linux/perf/arm_pmuv3.h includes asm/arm_pmuv3.h, and on 32-bit ARM the
static inline helpers in arch/arm/include/asm/arm_pmuv3.h expand
read_sysreg(), write_sysreg(), __ACCESS_CP15(), and __ACCESS_CP15_64():

arch/arm/include/asm/arm_pmuv3.h:read_pmevcntrn() {
    ...
#define RETURN_READ_PMEVCNTRN(n) \
	return read_sysreg(PMEVCNTR##n)
static inline unsigned long read_pmevcntrn(int n)
{
	PMEVN_SWITCH(n, RETURN_READ_PMEVCNTRN);
	return 0;
}
    ...
}

In arch/arm/include/asm/cp15.h and arch/arm/include/asm/vdso/cp15.h,
those macros are defined only under #ifdef CONFIG_CPU_CP15.  Previously
linux/perf/arm_pmuv3.h was only compiled on 32-bit ARM under
CONFIG_ARM_PMUV3 (which depends on CPU_V7 and thus CPU_CP15), whereas
CONFIG_ARM_PMU depends only on ARM || ARM64, so compiling
drivers/perf/arm_pmu.c without CONFIG_CPU_CP15 fails with undeclared
CP15 macros and helpers.

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/cover.1795182850.git.aaupov@fb.com?part=5

  reply	other threads:[~2026-11-20 15:40 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-20 15:21 [PATCH v5 0/7] coresight: Pulse an ETM external output for a PMU event Amir Ayupov
2026-11-20 15:21 ` [PATCH v5 1/7] coresight: etm4x: Fix event count decoding Amir Ayupov
2026-11-20 15:30   ` sashiko-bot
2026-11-20 15:21 ` [PATCH v5 2/7] coresight: syscfg: Fail to enable a configuration not loaded on the device Amir Ayupov
2026-11-20 15:36   ` sashiko-bot
2026-11-20 15:21 ` [PATCH v5 3/7] coresight: syscfg: Match feature capabilities separately from device class Amir Ayupov
2026-11-20 15:29   ` sashiko-bot
2026-11-20 15:21 ` [PATCH v5 4/7] coresight: syscfg: Remove unused CS_CFG_MATCH_INST_ANY Amir Ayupov
2026-11-20 15:30   ` sashiko-bot
2026-11-20 15:21 ` [PATCH v5 5/7] perf: arm_pmuv3: Add pmuv3_event_implemented() Amir Ayupov
2026-11-20 15:39   ` sashiko-bot [this message]
2026-11-20 15:21 ` [PATCH v5 6/7] coresight: etm4x: Report whether the PMU counts the external outputs Amir Ayupov
2026-11-20 15:36   ` sashiko-bot
2026-11-20 15:21 ` [PATCH v5 7/7] coresight: Add pmu_pulse/extout_pulse Amir Ayupov
2026-11-20 15:41   ` sashiko-bot

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=sashiko-outbox-225474@kernel.org \
    --to=sashiko-bot@kernel.org \
    --cc=aaupov@fb.com \
    --cc=linux-perf-users@vger.kernel.org \
    --cc=sashiko-reviews@lists.linux.dev \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox