mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Ashley Smith <ashley.smith@collabora.com>
To: lukas.zapolskas@arm.com
Cc: airlied@gmail.com, aliceryhl@google.com,
	boris.brezillon@collabora.com, daniel.almeida@collabora.com,
	dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org,
	liviu.dudau@arm.com, maarten.lankhorst@linux.intel.com,
	mripard@kernel.org, nd@arm.com, simona@ffwll.ch,
	steven.price@arm.com, tzimmermann@suse.de,
	Ashley Smith <ashley.smith@collabora.com>
Subject: Re: [PATCH v7 5/8] drm/panthor: Introduce sampling sessions to handle userspace clients
Date: Wed,  4 Nov 2026 17:39:01 +0000	[thread overview]
Message-ID: <20261104173921.4117593-1-ashley.smith@collabora.com> (raw)
In-Reply-To: <20261011-panthor-performance-counters-v7-5-12c32495062f@arm.com>

On Sun, Oct 11, 2026 at 06:36:52PM +0100, Lukas Zapolskas wrote:
> +	ret = panthor_perf_bo_get(file, create_args->control_handle, 0, &control);

Like the ringbuffer BO above, I think we need to include the size here since
if the actual size is less than what the kernel expects it could lead to
writing to out of bounds memory (imported BOs):

ret = panthor_perf_bo_get(file, create_args->control_handle, sizeof(
    struct drm_panthor_perf_ringbuf_control), &control);

Could also change panthor_perf_bo_get() to always test and instead
of != use <=

if (obj->size <= PFN_ALIGN(expected_size))

so callers cant silently skip validation.

FWIW, I have tested v7 of this patch series on a Rock5B and can see reliable
counter values.

Tested-by: Ashley Smith <ashley.smith@collabora.com>

  parent reply	other threads:[~2026-11-04 17:40 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-10-11 17:36 [PATCH v7 0/8] drm/panthor: Performance counter implementation with single manual client support Lukas Zapolskas
2026-10-11 17:36 ` [PATCH v7 1/8] drm/panthor: Add performance counter uAPI Lukas Zapolskas
2026-10-22 12:15   ` Liviu Dudau
2026-10-11 17:36 ` [PATCH v7 2/8] drm/panthor: Add register definitions for perf Lukas Zapolskas
2026-10-22 12:16   ` Liviu Dudau
2026-10-11 17:36 ` [PATCH v7 3/8] drm/panthor: Add DEV_QUERY.PERF_INFO handling Lukas Zapolskas
2026-10-23 13:54   ` Liviu Dudau
2026-10-11 17:36 ` [PATCH v7 4/8] drm/panthor: Add panthor perf initialization and termination Lukas Zapolskas
2026-10-23 13:58   ` Liviu Dudau
2026-10-11 17:36 ` [PATCH v7 5/8] drm/panthor: Introduce sampling sessions to handle userspace clients Lukas Zapolskas
2026-10-23 14:24   ` Liviu Dudau
2026-11-04 17:39   ` Ashley Smith [this message]
2026-10-11 17:36 ` [PATCH v7 6/8] drm/panthor: Implement sample handling Lukas Zapolskas
2026-10-13  4:52   ` kernel test robot
2026-10-23 14:30   ` Liviu Dudau
2026-10-11 17:36 ` [PATCH v7 7/8] drm/panthor: Add suspend, resume and reset handling Lukas Zapolskas
2026-10-23 14:32   ` Liviu Dudau
2026-10-11 17:36 ` [PATCH v7 8/8] drm/panthor: Expose the panthor perf ioctls Lukas Zapolskas
2026-10-23 14:33   ` Liviu Dudau

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=20261104173921.4117593-1-ashley.smith@collabora.com \
    --to=ashley.smith@collabora.com \
    --cc=airlied@gmail.com \
    --cc=aliceryhl@google.com \
    --cc=boris.brezillon@collabora.com \
    --cc=daniel.almeida@collabora.com \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=liviu.dudau@arm.com \
    --cc=lukas.zapolskas@arm.com \
    --cc=maarten.lankhorst@linux.intel.com \
    --cc=mripard@kernel.org \
    --cc=nd@arm.com \
    --cc=simona@ffwll.ch \
    --cc=steven.price@arm.com \
    --cc=tzimmermann@suse.de \
    /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

all inboxes | Powered by JetHome®