qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Thomas Huth <thuth@redhat.com>
To: Ilya Leoshkevich <iii@linux.ibm.com>, Laurent Vivier <laurent@vivier.eu>
Cc: Richard Henderson <richard.henderson@linaro.org>,
	David Hildenbrand <david@redhat.com>,
	qemu-s390x@nongnu.org, qemu-devel@nongnu.org,
	Christian Borntraeger <borntraeger@linux.ibm.com>
Subject: Re: [PATCH] linux-user/host/s390: Treat EX and EXRL as writes
Date: Wed, 4 May 2022 15:46:41 +0200	[thread overview]
Message-ID: <197bb25a-f9d4-c29b-8893-1ad73c135127@redhat.com> (raw)
In-Reply-To: <20220504114819.1729737-1-iii@linux.ibm.com>

On 04/05/2022 13.48, Ilya Leoshkevich wrote:
> clang-built s390x branch-relative-long test fails on clang-built s390x
> QEMU due to the following sequence of events:
> 
> - The test zeroes out a code page, clang generates exrl+xc for this.
> 
> - do_helper_xc() is called. Clang generates exrl+xc there as well.
> 
> - Since there already exists a TB for the code in question, its page is
>    read-only and SIGSEGV is raised.
> 
> - host_signal_handler() calls host_signal_write() and the latter does
>    not recognize exrl as a write. Therefore page_unprotect() is not
>    called and the signal is forwarded to the test.
> 
> Fix by treating EXRL (and EX, just in case) as writes. There may be
> false positives, but they will lead only to an extra page_unprotect()
> call.
> 
> Reported-by: Thomas Huth <thuth@redhat.com>
> Signed-off-by: Ilya Leoshkevich <iii@linux.ibm.com>
> ---
>   linux-user/include/host/s390/host-signal.h | 7 +++++++
>   1 file changed, 7 insertions(+)

Great, this fixes the crash for me, indeed! Thank you!

Tested-by: Thomas Huth <thuth@redhat.com>



  reply	other threads:[~2022-05-04 13:51 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-05-04 11:48 [PATCH] linux-user/host/s390: Treat EX and EXRL as writes Ilya Leoshkevich
2022-05-04 13:46 ` Thomas Huth [this message]
2022-05-04 15:27 ` Richard Henderson
2022-05-23 20:54 ` Laurent Vivier

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=197bb25a-f9d4-c29b-8893-1ad73c135127@redhat.com \
    --to=thuth@redhat.com \
    --cc=borntraeger@linux.ibm.com \
    --cc=david@redhat.com \
    --cc=iii@linux.ibm.com \
    --cc=laurent@vivier.eu \
    --cc=qemu-devel@nongnu.org \
    --cc=qemu-s390x@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 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).