From: Jan Kiszka <jan.kiszka@siemens.com>
To: Richard Weinberger <richard.weinberger@gmail.com>
Cc: Richard Weinberger <richard@sigma-star.at>,
Philippe Gerum <rpm@xenomai.org>,
Xenomai <xenomai@lists.linux.dev>
Subject: Re: [RFC][PATCH] x86: dovetail: Permit to declare a trap handled
Date: Mon, 8 Apr 2024 13:59:48 +0200 [thread overview]
Message-ID: <dc20fdf7-0bf7-43cb-8ff2-6a8dd261f879@siemens.com> (raw)
In-Reply-To: <CAFLxGvy0dQtnfjsgvAyv=8m4JubED7UTwdcvF_8eTkBc5+i+iQ@mail.gmail.com>
On 28.03.24 08:28, Richard Weinberger wrote:
> Jan,
>
> On Mon, Feb 12, 2024 at 5:12 PM Jan Kiszka <jan.kiszka@siemens.com> wrote:
>>>> Yes, I do have some first hacks here as well. ARM and ARM64 is not yet
>>>> ready for this, unfortunately.
>>>
>>> Can you please share your hacks?
>>> What is missing? I'll happily continue your work.
>>>
>>
>> Just refreshed [1], and the kernel side hacks are attached (mixture of
>> Johannes and my WIP changes). Blocker is really the level of kernel
>> enabling we need/want for non-x86. Those changes can be many. Also a
>> problem is the information forwarding from the exception handler to the
>> oob callback - missing in many cases, see also the dances needed in
>> xnarch_setup_trap_info().
>
> In commit 7e13c6997 ("rt-signal: kernel refactorings") I see the
> following change:
>
> diff --git a/kernel/cobalt/dovetail/kevents.c b/kernel/cobalt/dovetail/kevents.c
> index 5394c85d0..275a9f726 100644
> --- a/kernel/cobalt/dovetail/kevents.c
> +++ b/kernel/cobalt/dovetail/kevents.c
> @@ -56,7 +56,8 @@ void handle_oob_trap_entry(unsigned int trapnr,
> struct pt_regs *regs)
> xnsched_run();
> }
>
> - if (xnthread_handle_rt_signals(trapnr, regs) == 0)
> + if (xnthread_test_state(thread, XNUSER) &&
> + xnthread_handle_rt_signals(trapnr, regs))
> return;
>
> /*
>
> I guess the idea behind is making sure we handle only faults from user mode.
> But isn't XNUSER also present if a thread is executing a cobalt syscall?
> So, I think instead of just testing for XNUSER we need to check using
> user_mode(regs) too.
>
> What do you think?
>
I think the idea was to exclude kernel threads, but I'm not 100% sure
anymore. I agree that testing for user_mode should have that effect as
well and exclude kernel oopses - if we don't filter them elsewhere already.
Jan
--
Siemens AG, Technology
Linux Expert Center
next prev parent reply other threads:[~2024-04-08 11:59 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-07-08 7:11 [RFC][PATCH] x86: dovetail: Permit to declare a trap handled Jan Kiszka
2022-07-08 7:12 ` Jan Kiszka
2022-11-09 7:31 ` Johannes Kirchmair
2022-11-09 9:28 ` Jan Kiszka
2022-11-09 10:06 ` Philippe Gerum
2022-11-09 10:38 ` Jan Kiszka
2022-11-09 11:42 ` Johannes Kirchmair
2022-11-10 9:00 ` Philippe Gerum
2024-02-12 15:04 ` Richard Weinberger
2024-02-12 15:12 ` Jan Kiszka
2024-02-12 15:14 ` Richard Weinberger
2024-02-12 16:12 ` Jan Kiszka
2024-03-28 7:28 ` Richard Weinberger
2024-04-08 11:59 ` Jan Kiszka [this message]
2022-11-09 7:36 ` Johannes Kirchmair
2022-11-09 9:29 ` Jan Kiszka
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=dc20fdf7-0bf7-43cb-8ff2-6a8dd261f879@siemens.com \
--to=jan.kiszka@siemens.com \
--cc=richard.weinberger@gmail.com \
--cc=richard@sigma-star.at \
--cc=rpm@xenomai.org \
--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;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).