From: Ulrich Weigand <uweigand@de.ibm.com>
To: Laurent Vivier <laurent@vivier.eu>
Cc: "jonathan . albrecht" <jonathan.albrecht@linux.vnet.ibm.com>,
Ilya Leoshkevich <iii@linux.ibm.com>,
David Hildenbrand <david@redhat.com>,
Ulrich Weigand <ulrich.weigand@de.ibm.com>,
Cornelia Huck <cohuck@redhat.com>,
Richard Henderson <richard.henderson@linaro.org>,
qemu-devel@nongnu.org,
Christian Borntraeger <borntraeger@de.ibm.com>,
qemu-s390x@nongnu.org, Andreas Krebbel <krebbel@linux.ibm.com>
Subject: Re: [PATCH v5 0/2] target/s390x: Fix SIGILL/SIGFPE/SIGTRAP psw.addr reporting
Date: Fri, 2 Jul 2021 23:00:38 +0200 [thread overview]
Message-ID: <20210702210038.GA8031@oc3748833570.ibm.com> (raw)
In-Reply-To: <3624d483-dd11-6464-bbfd-ed2921b2fcfe@vivier.eu>
On Fri, Jul 02, 2021 at 02:01:47PM +0200, Laurent Vivier wrote:
> Le 02/07/2021 à 12:34, Cornelia Huck a écrit :
> > On Wed, Jun 23 2021, Ilya Leoshkevich <iii@linux.ibm.com> wrote:
> >
> >> qemu-s390x puts a wrong value into SIGILL's siginfo_t's psw.addr: it
> >> should be a pointer to the instruction following the illegal
> >> instruction, but at the moment it is a pointer to the illegal
> >> instruction itself. This breaks OpenJDK, which relies on this value.
> >> A similar problem exists for SIGFPE and SIGTRAP.
> >>
> >> Patch 1 fixes the issue, patch 2 adds a test.
> >>
> >> v1: https://lists.nongnu.org/archive/html/qemu-devel/2021-05/msg06592.html
> >> v1 -> v2: Use a better buglink (Cornelia), simplify the inline asm
> >> magic in the test and add an explanation (David).
> >>
> >> v2: https://lists.nongnu.org/archive/html/qemu-devel/2021-05/msg06649.html
> >> v2 -> v3: Fix SIGSEGV handling (found when trying to run valgrind under
> >> qemu-user).
> >>
> >> v3: https://lists.nongnu.org/archive/html/qemu-devel/2021-06/msg00299.html
> >> v3 -> v4: Fix compiling the test on Ubuntu 20.04 (Jonathan).
> >>
> >> v4: https://lists.nongnu.org/archive/html/qemu-devel/2021-06/msg05848.html
> >> v4 -> v5: Greatly simplify the fix (Ulrich).
> >>
> >> Note: the compare-and-trap SIGFPE issue is being fixed separately.
> >> https://lists.nongnu.org/archive/html/qemu-devel/2021-06/msg05690.html
> >>
> >> Ilya Leoshkevich (2):
> >> target/s390x: Fix SIGILL/SIGFPE/SIGTRAP psw.addr reporting
> >> tests/tcg/s390x: Test SIGILL and SIGSEGV handling
> >>
> >> linux-user/s390x/cpu_loop.c | 5 +
> >> tests/tcg/s390x/Makefile.target | 1 +
> >> tests/tcg/s390x/signal.c | 165 ++++++++++++++++++++++++++++++++
> >> 3 files changed, 171 insertions(+)
> >> create mode 100644 tests/tcg/s390x/signal.c
> >
> > What's the status of this and
> > <20210621141452.2045-1-jonathan.albrecht@linux.vnet.ibm.com>? linux-user
> > is not really my turf, but it would be sad if this fell through the
> > cracks.
> >
>
> If from the S390x point of view they are correct, I can collect them via linux-user.
It's certainly correct that SIGILL, SIGFPE and SIGTRAP are delivered with psw.addr
pointing *after* the faulting instruction, that forms in effect part of the kernel
ABI on s390x. We're planning to document this in the next revision of the ABI
document, see here: https://github.com/IBM/s390x-abi/issues/2
I can also confirm that this patch fixes the problems I was seeing when running
the s390x wasmtime JIT under qemu.
Bye,
Ulrich
--
Dr. Ulrich Weigand
GNU/Linux compilers and toolchain
Ulrich.Weigand@de.ibm.com
next prev parent reply other threads:[~2021-07-02 21:02 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-06-23 2:32 [PATCH v5 0/2] target/s390x: Fix SIGILL/SIGFPE/SIGTRAP psw.addr reporting Ilya Leoshkevich
2021-06-23 2:32 ` [PATCH v5 1/2] " Ilya Leoshkevich
2021-07-05 9:36 ` David Hildenbrand
2021-07-05 17:24 ` Ilya Leoshkevich
2021-07-05 19:18 ` David Hildenbrand
2021-07-05 20:19 ` Ilya Leoshkevich
2021-07-06 9:15 ` Ulrich Weigand
2021-06-23 2:32 ` [PATCH v5 2/2] tests/tcg/s390x: Test SIGILL and SIGSEGV handling Ilya Leoshkevich
2021-06-23 2:42 ` [PATCH v5 0/2] target/s390x: Fix SIGILL/SIGFPE/SIGTRAP psw.addr reporting no-reply
2021-07-02 10:34 ` Cornelia Huck
2021-07-02 12:01 ` Laurent Vivier
2021-07-02 21:00 ` Ulrich Weigand [this message]
2021-07-05 9:27 ` Cornelia Huck
2021-07-12 14:59 ` jonathan.albrecht
2021-07-12 21:22 ` 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=20210702210038.GA8031@oc3748833570.ibm.com \
--to=uweigand@de.ibm.com \
--cc=borntraeger@de.ibm.com \
--cc=cohuck@redhat.com \
--cc=david@redhat.com \
--cc=iii@linux.ibm.com \
--cc=jonathan.albrecht@linux.vnet.ibm.com \
--cc=krebbel@linux.ibm.com \
--cc=laurent@vivier.eu \
--cc=qemu-devel@nongnu.org \
--cc=qemu-s390x@nongnu.org \
--cc=richard.henderson@linaro.org \
--cc=ulrich.weigand@de.ibm.com \
/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).