From: Ilya Leoshkevich <iii@linux.ibm.com>
To: "Philippe Mathieu-Daudé" <philmd@linaro.org>,
"Alex Bennée" <alex.bennee@linaro.org>,
"Laurent Vivier" <laurent@vivier.eu>,
"Richard Henderson" <richard.henderson@linaro.org>
Cc: qemu-devel@nongnu.org, Michael Tokarev <mjt@tls.msk.ru>,
Brian Cain <bcain@quicinc.com>,
"ltaylorsimpson@gmail.com" <ltaylorsimpson@gmail.com>
Subject: Ping: [PATCH v2 1/2] linux-user: Map low priority rt signals
Date: Fri, 25 Oct 2024 11:32:24 +0200 [thread overview]
Message-ID: <6d3832490ebc7abc62652c9be1d27a70c5d7551c.camel@linux.ibm.com> (raw)
In-Reply-To: <2afc8b53-5a35-482c-aa89-c61a882cedf0@linaro.org>
On Tue, 2024-02-13 at 07:51 +0100, Philippe Mathieu-Daudé wrote:
> Cc'ing Brian & Taylor
>
> On 12/2/24 21:45, Ilya Leoshkevich wrote:
> > Some applications want to use low priority realtime signals (e.g.,
> > SIGRTMAX). Currently QEMU cannot map all target realtime signals to
> > host signals, and chooses to sacrifice the end of the target
> > realtime
> > signal range.
> >
> > Change this to the middle of that range, hoping that fewer
> > applications
> > will need it.
> >
> > Signed-off-by: Ilya Leoshkevich <iii@linux.ibm.com>
> > ---
> > linux-user/signal.c | 18 +++++++++++++-----
> > 1 file changed, 13 insertions(+), 5 deletions(-)
> >
> > diff --git a/linux-user/signal.c b/linux-user/signal.c
> > index d3e62ab030f..a81533b563a 100644
> > --- a/linux-user/signal.c
> > +++ b/linux-user/signal.c
> > @@ -511,13 +511,14 @@ static int core_dump_signal(int sig)
> >
> > static void signal_table_init(void)
> > {
> > - int hsig, tsig, count;
> > + int hsig, hsig_count, tsig, tsig_count, tsig_hole,
> > tsig_hole_size, count;
> >
> > /*
> > - * Signals are supported starting from TARGET_SIGRTMIN and
> > going up
> > - * until we run out of host realtime signals. Glibc uses the
> > lower 2
> > - * RT signals and (hopefully) nobody uses the upper ones.
> > - * This is why SIGRTMIN (34) is generally greater than
> > __SIGRTMIN (32).
> > + * Signals are supported starting from TARGET_SIGRTMIN and up
> > to
> > + * TARGET_SIGRTMAX, potentially with a hole in the middle of
> > this
> > + * range, which, hopefully, nobody uses. Glibc uses the lower
> > 2 RT
> > + * signals; this is why SIGRTMIN (34) is generally greater
> > than
> > + * __SIGRTMIN (32).
> > * To fix this properly we would need to do manual signal
> > delivery
> > * multiplexed over a single host signal.
> > * Attempts for configure "missing" signals via sigaction
> > will be
> > @@ -536,9 +537,16 @@ static void signal_table_init(void)
> > host_to_target_signal_table[SIGABRT] = 0;
> > host_to_target_signal_table[hsig++] = TARGET_SIGABRT;
> >
> > + hsig_count = SIGRTMAX - hsig + 1;
> > + tsig_count = TARGET_NSIG - TARGET_SIGRTMIN + 1;
> > + tsig_hole_size = tsig_count - MIN(hsig_count, tsig_count);
> > + tsig_hole = TARGET_SIGRTMIN + (tsig_count - tsig_hole_size) /
> > 2;
> > for (tsig = TARGET_SIGRTMIN;
> > hsig <= SIGRTMAX && tsig <= TARGET_NSIG;
> > hsig++, tsig++) {
> > + if (tsig == tsig_hole) {
> > + tsig += tsig_hole_size;
> > + }
> > host_to_target_signal_table[hsig] = tsig;
> > }
> >
Ping.
I wonder if it would make sense to make this configurable?
next prev parent reply other threads:[~2024-10-25 9:32 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-02-12 20:45 [PATCH v2 0/2] linux-user: Map low priority rt signals Ilya Leoshkevich
2024-02-12 20:45 ` [PATCH v2 1/2] " Ilya Leoshkevich
2024-02-13 6:51 ` Philippe Mathieu-Daudé
2024-10-25 9:32 ` Ilya Leoshkevich [this message]
2024-10-25 15:36 ` Ping: " Richard Henderson
2024-10-25 17:37 ` Ilya Leoshkevich
2024-02-12 20:45 ` [PATCH v2 2/2] tests/tcg: Add SIGRTMIN/SIGRTMAX test Ilya Leoshkevich
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=6d3832490ebc7abc62652c9be1d27a70c5d7551c.camel@linux.ibm.com \
--to=iii@linux.ibm.com \
--cc=alex.bennee@linaro.org \
--cc=bcain@quicinc.com \
--cc=laurent@vivier.eu \
--cc=ltaylorsimpson@gmail.com \
--cc=mjt@tls.msk.ru \
--cc=philmd@linaro.org \
--cc=qemu-devel@nongnu.org \
--cc=richard.henderson@linaro.org \
/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.