All of lore.kernel.org
 help / color / mirror / Atom feed
From: Philippe Gerum <rpm@xenomai.org>
To: Florian Bezdeka <florian.bezdeka@siemens.com>
Cc: Andrew MacPherson <andrew@elk.audio>,  xenomai@lists.linux.dev
Subject: Re: perf getting all-zeroes IP on STM32MP1
Date: Fri, 04 Sep 2026 17:17:57 +0200	[thread overview]
Message-ID: <87wlt1cafu.fsf@xenomai.org> (raw)
In-Reply-To: <9e0b7d3e72a19bd900a14faa6c459f5a2e093982.camel@siemens.com> (Florian Bezdeka's message of "Fri, 04 Sep 2026 16:08:02 +0200")

Florian Bezdeka <florian.bezdeka@siemens.com> writes:

> Hi Andrew,
>
> [CC + Philippe]
>
> On Fri, 2026-09-04 at 15:26 +0200, Andrew MacPherson wrote:
>> Hello,
>> 
>> We're working on an STM32MP1-based system running Xenomai and found
>> that perf top shows every symbol as "unknown [00000000]", i.e.
>> profiling is collecting samples, but they all point at address zero.
>> 
>> I'm not a kernel developer but went through a few debug kernel builds
>> with an agent which eventually led to the attached patch. This change
>> does resolve the issue with perf, however I'm not sure if it's the
>> correct solution.
>> 
>> The reasoning is that arm_arch_timer.c's percpu IRQ registration never
>> sets IRQF_TIMER, so Dovetail's copy_timer_regs() never populates
>> tick_regs, leaving get_irq_regs() to always return an all-zero
>> pt_regs, which in turn breaks perf's sample IP.
>
> Yep, that is wrong. The patch you provided looks OK to me. I'm just
> wondering if that should be addressed in Linux as well / first.
>

In fact, Dovetail is somewhat abusing IRQF_TIMER in that the only bit in
that mask we should care about is __IRQF_TIMER, which is only used for
recovering from misrouted IRQs these days, specifically excluding some
descriptors from the polling loop which tries to find a proper
handler. Problem is that we also carry the no-suspend semantics attached
to this mask when using it, which is not what we mean.

I think that the mainline code simply acknowledges the fact that per-CPU
interrupt handlers should never be polled for solving a misrouted IRQ
issue by definition, so there is no point in tagging those lines with
__IRQ_TIMER in the first place, which applies to the architected timer
interrupt as well. IIRC, that was the point of the recent set of
upstream changes to request_percpu_irq(), dropping those flags. Such
change prompted us to put back a secondary interface accepting flags so
that we can keep on passing IRQF_TIMER.

> @Philippe: Any additional thoughts? Should we take it already?
>

I believe that we should not live much longer with this hack, we should
provide a dedicated IRQF_* flag introduced by Dovetail instead that
would specifically say "this line generates deferred tick events" or
something along these lines.

>
> @Andrew: Could you please provide a formal patch with proper signed-off
> and LLM notice (assuming agent means AI ;-)) targeting the dovetail 7.2.
> branch? That should help to speed things up. Thanks!
>
> Florian

-- 
Philippe.

  reply	other threads:[~2026-09-04 15:18 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-09-04 13:26 perf getting all-zeroes IP on STM32MP1 Andrew MacPherson
2026-09-04 14:08 ` Florian Bezdeka
2026-09-04 15:17   ` Philippe Gerum [this message]
2026-09-04 15:55     ` Florian Bezdeka
2026-09-05  9:16       ` Philippe Gerum
2026-09-07  8:57   ` Andrew MacPherson
2026-09-07 11:34     ` Florian Bezdeka
2026-09-07 12:03       ` Gerte Hoogewerf
2026-09-07 12:41       ` Philippe Gerum
2026-09-07 14:39         ` Florian Bezdeka
2026-09-07 15:00           ` Philippe Gerum
2026-09-08  8:02             ` Florian Bezdeka
2026-09-08  8:16               ` Philippe Gerum
2026-09-08  8:46                 ` Florian Bezdeka
2026-09-09  8:21                   ` Philippe Gerum
2026-09-09  8:29                     ` Florian Bezdeka
2026-09-09  8:49                       ` Philippe Gerum
2026-09-08  8:11         ` Philippe Gerum
2026-09-07 12:51       ` Andrew MacPherson

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=87wlt1cafu.fsf@xenomai.org \
    --to=rpm@xenomai.org \
    --cc=andrew@elk.audio \
    --cc=florian.bezdeka@siemens.com \
    --cc=xenomai@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.