Linux-ARM-Kernel Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Jiangtian Feng <jiangtianfeng@linux.alibaba.com>
To: Will Deacon <will@kernel.org>,
	Mark Rutland <mark.rutland@arm.com>,
	Besar Wicaksono <bwicaksono@nvidia.com>
Cc: Robin Murphy <robin.murphy@arm.com>,
	linux-arm-kernel@lists.infradead.org,
	linux-perf-users@vger.kernel.org, linux-kernel@vger.kernel.org,
	jiangtianfeng@linux.alibaba.com
Subject: [PATCH 0/2] perf/arm_cspmu: nvidia: Fix TGT address-filter handling
Date: Fri, 27 Nov 2026 15:10:08 +0800	[thread overview]
Message-ID: <20261127071021.820833-1-jiangtianfeng@linux.alibaba.com> (raw)

The Tegra410 PCIE-TGT implementation has two independent issues in its
address-filter handling.

First, an empty ACPI memory-resource list is accepted during probe,
leaving addr_filter_reg as NULL and allowing a later filter event to
perform an invalid MMIO access.

Second, the slot lookup can allocate a free slot before finding an
identical active filter, reset can match zeroed metadata from a free
slot, and cycle events can reset a slot they never allocated. These can
cause wrong-slot release, refcount underflow, and loss of filtering for
an active event.

This series rejects the missing resource at probe and fixes the slot
lifecycle without changing the shared PMU callback ABI or rejecting
valid zero base/mask filter data.

AI assistance disclosure:
Qoder AI coding assistant was used with the current upstream source and
the identified defect sequences as inputs. It contributed to the problem
analysis, code changes, state model, and changelog drafts. The human
submitter is responsible for reviewing the complete series and adding
their own Signed-off-by tags.

Validation:
- source-derived model reproduces wrong-slot release, zero base/mask
  underflow, and cycle/reset underflow before the fix;
- the proposed lifecycle model passes those cases and 100 x 500 random
  operations;
- independent static review covers duplicate filters, arbitrary stop
  order, zero base/mask, cycle, full slots, and reset-without-allocation;
- checkpatch.pl reports no issues other than the expected missing human
  Signed-off-by tags in this unsigned draft;
- complete ARM64 Image builds successfully;
- nvidia_cspmu.o and arm_cspmu.o build with W=1 without new warnings.

NOT_RUN:
- runtime fault injection or probe validation with abnormal ACPI tables;
- real address filtering, duplicate event start/stop, cycle/reset, slot
  exhaustion, module reload, or multi-RC testing;
- PCIe/CXL traffic, target hardware, existing Ampere/NVIDIA runtime
  regression, or long-duration testing.

Jiangtian Feng (2):
  perf/arm_cspmu: nvidia: Reject missing TGT address-filter resource
  perf/arm_cspmu: nvidia: Fix TGT address-filter slot lifecycle

 drivers/perf/arm_cspmu/nvidia_cspmu.c | 23 ++++++++++++++++++-----
 1 file changed, 18 insertions(+), 5 deletions(-)

-- 
2.47.3



             reply	other threads:[~2026-11-27  7:11 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-27  7:10 Jiangtian Feng [this message]
2026-11-27  7:10 ` [PATCH 1/2] perf/arm_cspmu: nvidia: Reject missing TGT address-filter resource Jiangtian Feng
2026-11-27  7:10 ` [PATCH 2/2] perf/arm_cspmu: nvidia: Fix TGT address-filter slot lifecycle Jiangtian Feng

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=20261127071021.820833-1-jiangtianfeng@linux.alibaba.com \
    --to=jiangtianfeng@linux.alibaba.com \
    --cc=bwicaksono@nvidia.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-perf-users@vger.kernel.org \
    --cc=mark.rutland@arm.com \
    --cc=robin.murphy@arm.com \
    --cc=will@kernel.org \
    /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