All of lore.kernel.org
 help / color / mirror / Atom feed
From: sashiko-bot@kernel.org
To: "Athira Rajeev" <atrajeev@linux.ibm.com>
Cc: linux-perf-users@vger.kernel.org
Subject: Re: [PATCH V2 1/6] tools/perf: Move powerpc VPA-DTL auxtrace init into a separate file
Date: Mon, 20 Jul 2026 11:15:54 +0000	[thread overview]
Message-ID: <20260720111554.990641F00A3A@smtp.kernel.org> (raw)
In-Reply-To: <20260720105218.14277-2-atrajeev@linux.ibm.com>

Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [Medium] The newly added file `vpa-dtl.c` uses `zalloc()` but fails to include `<linux/zalloc.h>`. On 64-bit platforms like PowerPC, this implicit declaration causes the compiler to assume `zalloc` returns `int`, leading to the truncation of the upper 32 bits of the returned 64-bit pointer.
--

--- Patch [1]: [PATCH V2 1/6] tools/perf: Move powerpc VPA-DTL auxtrace init into a separate file ---
commit 36d571f8cc56fc84bd8c942791167ff968206898
Author: Athira Rajeev <atrajeev@linux.ibm.com>

tools/perf: Move powerpc VPA-DTL auxtrace init into a separate file

This commit extracts the VPA-DTL auxtrace recording initializer into a new
file, vpa-dtl.c. It reduces auxtrace.c to a thin dispatch layer to prepare
for HTM recording.

> diff --git a/tools/perf/arch/powerpc/util/vpa-dtl.c b/tools/perf/arch/powerpc/util/vpa-dtl.c
> new file mode 100644
> index 0000000000000..fde388d874775
> --- /dev/null
> +++ b/tools/perf/arch/powerpc/util/vpa-dtl.c
> @@ -0,0 +1,95 @@
> +// SPDX-License-Identifier: GPL-2.0
> +/*
> + * VPA DTL AUX tracing support
> + */
> +
> +#include <linux/kernel.h>
> +#include <linux/types.h>
> +#include <linux/string.h>
> +#include <errno.h>
> +#include <stdlib.h>
> +#include <limits.h>
> +#include "../../util/cpumap.h"
> +#include "../../util/evsel.h"
> +#include "../../util/evlist.h"
> +#include "../../util/session.h"
> +#include "../../util/util.h"
> +#include "../../util/debug.h"
> +#include "../../util/auxtrace.h"
> +#include "../../util/powerpc-vpadtl.h"
> +#include "../../util/record.h"
> +#include <internal/lib.h> // page_size

[ ... ]

> +struct auxtrace_record *vpa_dtl_recording_init(struct evsel *pos, int *err)
> +{
> +	struct auxtrace_record *aux;
> +
> +	/*
> +	 * To obtain the auxtrace buffer file descriptor, the auxtrace event
> +	 * must come first.
> +	 */
> +	evlist__to_front(pos->evlist, pos);
> +
> +	aux = zalloc(sizeof(*aux));

[Severity: Medium]
Is the <linux/zalloc.h> include missing from the headers at the top of the
file?

Since zalloc is used here without a declaration, the compiler will treat it
as implicitly declared and returning an int. On 64-bit platforms like PowerPC,
this truncates the upper 32 bits of the returned pointer, which could result
in a segmentation fault at runtime.

> +	if (aux == NULL) {
> +		pr_debug("aux record allocation failed (-ENOMEM)\n");
> +		*err = -ENOMEM;
> +		return NULL;
> +	}

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20260720105218.14277-1-atrajeev@linux.ibm.com?part=1

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

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-07-20 10:52 [PATCH V2 0/6] tools/perf: Add powerpc HTM auxtrace support Athira Rajeev
2026-07-20 10:52 ` [PATCH V2 1/6] tools/perf: Move powerpc VPA-DTL auxtrace init into a separate file Athira Rajeev
2026-07-20 11:15   ` sashiko-bot [this message]
2026-07-20 10:52 ` [PATCH V2 2/6] tools/perf: Add AUXTRACE recording support for powerpc HTM Athira Rajeev
2026-07-20 11:20   ` sashiko-bot
2026-07-20 10:52 ` [PATCH V2 3/6] tools/perf: Add arch hook to drain remaining data before event close Athira Rajeev
2026-07-20 11:16   ` sashiko-bot
2026-07-20 10:52 ` [PATCH V2 4/6] tools/perf: Add powerpc callback support for arch_perf_record__need_read Athira Rajeev
2026-07-20 11:18   ` sashiko-bot
2026-07-20 10:52 ` [PATCH V2 5/6] tools/perf: Add powerpc HTM auxtrace event processing support Athira Rajeev
2026-07-20 11:18   ` sashiko-bot
2026-07-20 10:52 ` [PATCH V2 6/6] tools/perf: Add perf tool support for processing powerpc HTM AUXTRACE records Athira Rajeev
2026-07-20 11:25   ` 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=20260720111554.990641F00A3A@smtp.kernel.org \
    --to=sashiko-bot@kernel.org \
    --cc=atrajeev@linux.ibm.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.