From: Richard Henderson <richard.henderson@linaro.org>
To: Peter Maydell <peter.maydell@linaro.org>,
qemu-arm@nongnu.org, qemu-devel@nongnu.org
Cc: Christophe Lyon <christophe.lyon@linaro.org>
Subject: Re: [Qemu-devel] [PATCH] target/arm: Don't abort on M-profile exception return in linux-user mode
Date: Thu, 22 Aug 2019 10:02:55 -0700 [thread overview]
Message-ID: <c944bd01-14e0-b9f0-28a8-2dee677ed6c4@linaro.org> (raw)
In-Reply-To: <20190822131534.16602-1-peter.maydell@linaro.org>
On 8/22/19 6:15 AM, Peter Maydell wrote:
> The upshot of all this is that for linux-user mode we should never
> do any of the bx_excret magic, so the code change is simple.
>
> This ought to be a weird corner case that only affects broken guest
> code (because Linux user processes should never be attempting to do
> exception returns or NS function returns), except that the code that
> assigns addresses in RAM for the process and stack in our linux-user
> code does not attempt to avoid this magic address range, so
> legitimate code attempting to return to a trampoline routine on the
> stack can fall into this case. This change fixes those programs,
> but we should also look at restricting the range of memory we
> use for M-profile linux-user guests to the area that would be
> real RAM in hardware.
>
> Cc: qemu-stable@nongnu.org
> Reported-by: Christophe Lyon <christophe.lyon@linaro.org>
> Fixes: https://bugs.launchpad.net/qemu/+bug/1840922
> Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
> I have no idea how we could achieve the "restrict addresses
> shown to guest for linux-user" mentioned in the last para:
> any suggestions?
I guess we'd want a new cpu hook, and change MAX_RESERVED_VA
from a macro into a function call.
Move the cpu_create() in linux-user/main.c up a few lines
before we default reserved_va for 64-bit hosts.
Move the check of the command-line setting of reserved_va
vs MAX_RESERVED_VA out from handle_arg_reserved_va to just
after the aforementioned default.
Seems plausible, anyway.
r~
prev parent reply other threads:[~2019-08-22 17:04 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-08-22 13:15 [Qemu-devel] [PATCH] target/arm: Don't abort on M-profile exception return in linux-user mode Peter Maydell
2019-08-22 17:02 ` Richard Henderson [this message]
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=c944bd01-14e0-b9f0-28a8-2dee677ed6c4@linaro.org \
--to=richard.henderson@linaro.org \
--cc=christophe.lyon@linaro.org \
--cc=peter.maydell@linaro.org \
--cc=qemu-arm@nongnu.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).