From: sashiko-bot@kernel.org
To: "Stian Halseth" <stian@itx.no>
Cc: linux-perf-users@vger.kernel.org
Subject: Re: [RFC PATCH v3 2/3] sparc64: Support PERF_SAMPLE_REGS_USER and PERF_SAMPLE_STACK_USER
Date: Wed, 23 Sep 2026 09:14:06 +0000 [thread overview]
Message-ID: <20260923091406.C7FD81F00893@smtp.kernel.org> (raw)
In-Reply-To: <20260923090429.2026529-3-stian@itx.no>
> Select HAVE_PERF_REGS and HAVE_PERF_USER_STACK_DUMP and add the
> perf_regs implementation. The exposed registers mirror struct pt_regs:
> %g1-%g7, %o0-%o7 (named from the user's point of view; pt_regs calls
> them UREG_I*), %tstate, NPC and %y, with the PC in the slot of %g0, as
> mips and loongarch do for their hardwired-zero register. Trap entry
> does not save %g0, so its pt_regs slot holds stale stack contents for
> a trap taken in the kernel and must not be exposed.
>
> %o6 is reported as held in the register, i.e. with the 2047 stack bias
> for a 64-bit stack, the same as ptrace and user_stack_pointer(). The
> stack dump starts at the stack's actual address instead, %o6 + 2047
> when test_thread_64bit_stack() says so, so that it begins at the
> sampled frame; the uapi header documents this for consumers.
>
> User-mode values of a 32-bit task are truncated to 32 bits as
> genregs32_get() does, since the hardware does not zero-extend them.
> Kernel-mode registers, as seen by PERF_SAMPLE_REGS_INTR, are left
> alone.
>
> perf_arch_prepare_ustack() flushes the user register windows so the
> sampled window's %l and %i registers are in the dumped stack, where a
> DWARF unwinder needs them: the CFI of a function after `save` defines
> the CFA in terms of %i6.
>
> This makes perf record --call-graph dwarf and eu-stackprof usable on
> sparc64.
>
> Signed-off-by: Stian Halseth <stian@itx.no>
Sashiko has reviewed this patch and found no issues. It looks great!
--
Sashiko AI review · https://sashiko.dev/#/patchset/20260923090429.2026529-1-stian@itx.no?part=2
next prev parent reply other threads:[~2026-09-23 9:14 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-09-23 9:04 [RFC PATCH v3 0/3] perf: sparc64 user regs and stack dump, with arch hooks Stian Halseth
2026-09-23 9:04 ` [RFC PATCH v3 1/3] perf/core: Let an arch prepare and locate the user stack dump Stian Halseth
2026-09-23 9:16 ` sashiko-bot
2026-09-23 9:04 ` [RFC PATCH v3 2/3] sparc64: Support PERF_SAMPLE_REGS_USER and PERF_SAMPLE_STACK_USER Stian Halseth
2026-09-23 9:14 ` sashiko-bot [this message]
2026-09-23 9:04 ` [RFC PATCH v3 3/3] perf tools: Support sparc user register samples and dwarf unwinding Stian Halseth
2026-09-23 9:14 ` sashiko-bot
2026-09-23 9:42 ` Stian Halseth
2026-09-23 16:02 ` Ian Rogers
2026-09-23 19:36 ` Stian Halseth
2026-09-23 20:38 ` [RFC PATCH v3 0/3] perf: sparc64 user regs and stack dump, with arch hooks Ian Rogers
2026-09-23 20:56 ` Stian Halseth
2026-09-23 21:16 ` Ian Rogers
2026-09-24 17:09 ` Arnaldo Carvalho de Melo
2026-09-24 17:11 ` Arnaldo Carvalho de Melo
2026-09-25 7:33 ` Stian Halseth
2026-09-23 23:10 ` Magnus Lindholm
2026-09-24 8:20 ` Stian Halseth
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=20260923091406.C7FD81F00893@smtp.kernel.org \
--to=sashiko-bot@kernel.org \
--cc=linux-perf-users@vger.kernel.org \
--cc=sashiko-reviews@lists.linux.dev \
--cc=stian@itx.no \
/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