From: Richard Henderson <richard.henderson@linaro.org>
To: qemu-devel@nongnu.org
Cc: lvivier@redhat.com, peter.maydell@linaro.org,
alex.bennee@linaro.org, pbonzini@redhat.com
Subject: [Qemu-devel] [PATCH 0/5] tcg: Fix mmap_lock assertion failure, take 2
Date: Tue, 9 Jul 2019 11:20:44 +0200 [thread overview]
Message-ID: <20190709092049.13771-1-richard.henderson@linaro.org> (raw)
While I could not replicate the failure Peter reported, the apparent
root cause -- the old magic fixed page -- should affect other guests
as well. In particular, the old arm32 magic fixed page at 0xffff0f00,
and the hppa magic fixed page at 0.
In the arm32 and hppa cases that I just mentioned -- but notably not
the x86_64 case that Peter reported -- there is special-case code in
target/*/translate.c to handle those addresses without actually doing
the read from the unmapped address.
Therefore, until we fix these sort of address space representational
errors, we cannot even rely on page_check_range() to validate the
execute access.
Instead, modify the host signal handler to intercept this at SIGSEGV.
At this point we're sure that there is no guest special case that we
have overlooked, because we did attempt the read for execute.
Also, I noticed that we really ought to have some barriers around this
code to make sure that the modifications to helper_retaddr are in fact
visible to the host signal handler.
Also, some minor cleanups to the set of read functions that we expose
for use during translation.
Also, a trivial duplicated condition.
r~
Richard Henderson (5):
include/qemu/atomic.h: Add signal_barrier
tcg: Introduce set/clear_helper_retaddr
tcg: Remove cpu_ld*_code_ra
tcg: Remove duplicate #if !defined(CODE_ACCESS)
tcg: Release mmap_lock on translation fault
include/exec/cpu_ldst.h | 20 ++++++
include/exec/cpu_ldst_useronly_template.h | 40 ++++++++----
include/qemu/atomic.h | 11 ++++
accel/tcg/user-exec.c | 76 ++++++++++++++++-------
target/arm/helper-a64.c | 8 +--
target/arm/sve_helper.c | 43 +++++++------
6 files changed, 135 insertions(+), 63 deletions(-)
--
2.17.1
next reply other threads:[~2019-07-09 9:22 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-07-09 9:20 Richard Henderson [this message]
2019-07-09 9:20 ` [Qemu-devel] [PATCH 1/5] include/qemu/atomic.h: Add signal_barrier Richard Henderson
2019-07-09 10:03 ` Alex Bennée
2019-07-09 9:20 ` [Qemu-devel] [PATCH 2/5] tcg: Introduce set/clear_helper_retaddr Richard Henderson
2019-07-09 10:07 ` Alex Bennée
2019-07-09 10:16 ` Richard Henderson
2019-07-09 10:43 ` Alex Bennée
2019-07-09 9:20 ` [Qemu-devel] [PATCH 3/5] tcg: Remove cpu_ld*_code_ra Richard Henderson
2019-07-09 10:09 ` Alex Bennée
2019-07-09 9:20 ` [Qemu-devel] [PATCH 4/5] tcg: Remove duplicate #if !defined(CODE_ACCESS) Richard Henderson
2019-07-09 10:11 ` Alex Bennée
2019-07-09 9:20 ` [Qemu-devel] [PATCH 5/5] tcg: Release mmap_lock on translation fault Richard Henderson
2019-07-09 10:37 ` Alex Bennée
2019-07-09 11:04 ` [Qemu-devel] [PATCH 0/5] tcg: Fix mmap_lock assertion failure, take 2 no-reply
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=20190709092049.13771-1-richard.henderson@linaro.org \
--to=richard.henderson@linaro.org \
--cc=alex.bennee@linaro.org \
--cc=lvivier@redhat.com \
--cc=pbonzini@redhat.com \
--cc=peter.maydell@linaro.org \
--cc=qemu-devel@nongnu.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).