From: Philippe Gerum <rpm@xenomai.org>
To: Florian Bezdeka <florian.bezdeka@siemens.com>
Cc: Xenomai <xenomai@lists.linux.dev>, Jan Kiszka <jan.kiszka@siemens.com>
Subject: Re: [PATCH Dovetail 2/2] arm64: irq_pipeline: Fix the demotion checks for el0 and el1 IRQs
Date: Tue, 17 Feb 2026 10:40:46 +0100 [thread overview]
Message-ID: <87tsvf9081.fsf@xenomai.org> (raw)
In-Reply-To: <430245ce2bc8da023235e9cf1312f729d7c57494.camel@siemens.com> (Florian Bezdeka's message of "Tue, 17 Feb 2026 10:16:21 +0100")
Florian Bezdeka <florian.bezdeka@siemens.com> writes:
> On Tue, 2026-02-17 at 09:41 +0100, Philippe Gerum wrote:
>> > Comparing with x86 again, I think that my proposal is "correct" in terms
>> > of identical to what x86 does. Do all architectures have a gap here?
>>
>> x86 has a single implementation for both user and kernel preemption
>> paths, arm64 has two since the privilege level is explicitly stated by
>> the irq handler being called, but this still must translate identically
>> logically speaking. Your implementation is missing the kernel preemption
>> path after demotion.
>>
>> i.e. when checking for running_oob() || irqs_disabled(), the cases
>> covered are:
>>
>> (1) in-band user path on entry (implies !irqs_disabled())
>> (2) oob user path on entry (might be demoted)
>> (3) (virtually) stalled in-band kernel path on entry (implies no reschedule,
>> filtered out by irqentry_exit())
>> (4) oob kernel path on entry (might be demoted)
>>
>> Therefore, with your patch in, el1 is now missing (4).
>
> Right, but I'm wondering if x86 ignores this case as well.
>
> After demotion of a oob kernel path entry, user_mode() should still be
> false - bypassing the call to irqentry_exit_to_user_mode() - No?
Yes, x86 assumes that a kernel path demoted to in-band is going to cross
an IRQ synchronization point shortly after on return to the preempted
context. Now, with hindsight, the question is: are we 100% certain of
that? Any real (hw) IRQ over the in-band stage would trigger the
synchronization as expected, but a synthetic one posted from the oob
stage might linger if this assumption ends up being wrong. I need to
have a second look at this code.
--
Philippe.
next prev parent reply other threads:[~2026-02-17 9:40 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-02-16 19:05 [PATCH Dovetail 0/2] Dovetail: Fix for arm64 IRQ pipelining, API for co-kernels Florian Bezdeka
2026-02-16 19:05 ` [PATCH Dovetail 1/2] dovetail: genirq: Add request_percpu_irq_affinity_flags() Florian Bezdeka
2026-02-16 19:05 ` [PATCH Dovetail 2/2] arm64: irq_pipeline: Fix the demotion checks for el0 and el1 IRQs Florian Bezdeka
2026-02-17 8:00 ` Philippe Gerum
2026-02-17 8:12 ` Florian Bezdeka
2026-02-17 8:24 ` Florian Bezdeka
2026-02-17 8:41 ` Philippe Gerum
2026-02-17 9:16 ` Florian Bezdeka
2026-02-17 9:40 ` Philippe Gerum [this message]
2026-02-17 10:11 ` Philippe Gerum
2026-02-17 11:23 ` Florian Bezdeka
2026-02-17 13:31 ` Philippe Gerum
2026-02-17 14:37 ` Florian Bezdeka
2026-02-17 8:49 ` Philippe Gerum
2026-02-17 9:01 ` Florian Bezdeka
2026-02-17 9:10 ` Philippe Gerum
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=87tsvf9081.fsf@xenomai.org \
--to=rpm@xenomai.org \
--cc=florian.bezdeka@siemens.com \
--cc=jan.kiszka@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox