From: Cyril Hrubis <chrubis@suse.cz>
To: Richard Palethorpe <rpalethorpe@suse.de>
Cc: ltp@lists.linux.it
Subject: Re: [LTP] [PATCH] syscalls/waitid10: Fix on ARM, PPC and possibly others
Date: Thu, 31 Mar 2022 15:08:08 +0200 [thread overview]
Message-ID: <YkWnuA2a+QRQpc5R@yuki> (raw)
In-Reply-To: <8735iyl7z8.fsf@suse.de>
Hi!
> >> I'm wondering if we should branch on the architecture. If it's x86[_64]
> >> then we only do divide by zero as it's reasonable to think that if the
> >> signal is not raised then this is a bug.
> >
> > It's more likely to be a hardware bug/missing feature though. Do we
> > really care? I'd argue that removing the division altogether and just
> > calling raise(SIGFPE) in the child process is all we need in this
> > particular test.
>
> I suppose it depends on if there is a substantial difference in how the
> signal is raised between div by zero and raise. I guess there is some
> configuration to trap the faulting instruction and raise a
> signal.
I guess that in the case of division by zero we end up in the kernel
interrupt handler where the kernel looks up the process that was running
when the interrupt has raised then it queues the signal delivery and so
on.
In the case of raise() we just do sysenter instruction which triggers
different interrupt handler and the rest would be the same we queue the
signal and so on.
Which is why I think that there is some value in triggering the divison
by zero on architectures that enable it by default because we execute
kernel interrupt handler that is rarely being executed.
--
Cyril Hrubis
chrubis@suse.cz
--
Mailing list info: https://lists.linux.it/listinfo/ltp
next prev parent reply other threads:[~2022-03-31 13:06 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-03-10 10:55 [LTP] [PATCH] syscalls/waitid10: Fix on ARM, PPC and possibly others Cyril Hrubis
2022-03-10 10:58 ` Cyril Hrubis
2022-03-21 15:48 ` Richard Palethorpe
2022-03-22 9:24 ` Cyril Hrubis
2022-03-30 13:29 ` Richard Palethorpe
2022-03-30 13:37 ` Martin Doucha
2022-03-31 10:07 ` Richard Palethorpe
2022-03-31 13:08 ` Cyril Hrubis [this message]
2022-04-19 8:07 ` Jan Stancek
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=YkWnuA2a+QRQpc5R@yuki \
--to=chrubis@suse.cz \
--cc=ltp@lists.linux.it \
--cc=rpalethorpe@suse.de \
/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