From: Richard Weinberger <richard.weinberger@gmail.com>
To: xenomai@lists.linux.dev
Cc: "J. Kiszka" <jan.kiszka@siemens.com>,
"Bezdeka, Florian" <florian.bezdeka@siemens.com>,
David Oberhollenzer <david.oberhollenzer@sigma-star.at>
Subject: Re: [PATCH 1/3] [POC] test implementaion of rt-signals
Date: Tue, 5 Mar 2024 16:54:09 +0100 [thread overview]
Message-ID: <CAFLxGvyhP+qEfrZQVvOqrLbLmhq48k2G5aA12b9sowKXZeDtTw@mail.gmail.com> (raw)
In-Reply-To: <20230816101842.3377643-1-johannes.kirchmair@sigmatek.at>
On Wed, Aug 16, 2023 at 12:19 PM Johannes Kirchmair
<johannes.kirchmair@sigmatek.at> wrote:
> diff --git a/kernel/cobalt/dovetail/kevents.c b/kernel/cobalt/dovetail/kevents.c
> index 4da4f51b7..61417717b 100644
> --- a/kernel/cobalt/dovetail/kevents.c
> +++ b/kernel/cobalt/dovetail/kevents.c
> @@ -57,6 +57,9 @@ void handle_oob_trap_entry(unsigned int trapnr, struct pt_regs *regs)
> xnsched_run();
> }
>
> + if (xnthread_handle_rt_signals(trapnr, regs) == 0)
> + return;
> +
While continuing Johannes' work I noticed a problem with this code.
If we happen to trigger another exception while setting up the signal
frame a domain
switch could have happened and the subsequently call to
xnthread_relax() will crash the kernel
because it works only when we're in the primary domain.
e.g. if regs->sp points to a bogus memory location in userspace,
xnthread_handle_rt_signals() will
not only fail but also switch domains due to a page fault.
We'll return here relaxed.
My current workaround is a check like:
if (is_secondary_domain())
return;
> /*
> * If we experienced a trap on behalf of a shadow thread
> * running in primary mode, move it to the Linux domain,
> @@ -88,6 +91,8 @@ void handle_oob_trap_entry(unsigned int trapnr, struct pt_regs *regs)
> xnstat_counter_inc(&thread->stat.pf);
>
> xnthread_relax(xnarch_fault_notify(trapnr), SIGDEBUG_MIGRATE_FAULT);
> +
> + return;
> }
--
Thanks,
//richard
next prev parent reply other threads:[~2024-03-05 15:54 UTC|newest]
Thread overview: 30+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-08-16 10:18 [PATCH 1/3] [POC] test implementaion of rt-signals Johannes Kirchmair
2023-08-16 10:18 ` [PATCH 2/3] [POC] Add rt_signal test Johannes Kirchmair
2023-08-16 10:18 ` [PATCH 3/3] [POC] add a tool to measure rt_signal latency Johannes Kirchmair
2023-08-16 11:24 ` [PATCH 1/3] [POC] test implementaion of rt-signals Florian Bezdeka
2023-08-16 11:36 ` Jan Kiszka
2023-08-16 11:59 ` Johannes Kirchmair
2023-09-07 10:48 ` Johannes Kirchmair
2023-09-11 8:41 ` Florian Bezdeka
2023-09-01 12:00 ` Jan Kiszka
2023-09-01 13:38 ` Jan Kiszka
2023-09-04 6:55 ` Johannes Kirchmair
2023-09-07 13:39 ` Jan Kiszka
2023-09-07 13:58 ` Johannes Kirchmair
2023-09-01 13:51 ` Jan Kiszka
2023-09-01 14:11 ` Jan Kiszka
2023-09-04 7:04 ` Johannes Kirchmair
2024-03-05 15:54 ` Richard Weinberger [this message]
2024-03-05 17:05 ` Jan Kiszka
2024-03-05 17:14 ` Richard Weinberger
-- strict thread matches above, loose matches on Subject: below --
2023-09-08 10:50 Johannes Kirchmair
2023-09-08 10:54 ` Johannes Kirchmair
2023-09-09 11:35 ` Jan Kiszka
2023-05-09 13:13 Johannes Kirchmair
2023-05-09 13:17 ` Johannes Kirchmair
2023-05-12 17:38 ` Jan Kiszka
2023-05-15 6:50 ` Johannes Kirchmair
2023-05-15 10:38 ` Jan Kiszka
2023-05-16 6:46 ` Johannes Kirchmair
2023-05-16 6:52 ` Jan Kiszka
2023-08-09 9:50 ` Schaffner, Tobias
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=CAFLxGvyhP+qEfrZQVvOqrLbLmhq48k2G5aA12b9sowKXZeDtTw@mail.gmail.com \
--to=richard.weinberger@gmail.com \
--cc=david.oberhollenzer@sigma-star.at \
--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;
as well as URLs for NNTP newsgroup(s).