From: Peter Maydell <peter.maydell@linaro.org>
To: Richard Henderson <richard.henderson@linaro.org>
Cc: QEMU Developers <qemu-devel@nongnu.org>,
Sven Schnelle <svens@stackframe.org>
Subject: Re: [Qemu-devel] [PATCH] target/hppa: Check for page crossings in use_goto_tb
Date: Fri, 8 Mar 2019 19:04:23 +0000 [thread overview]
Message-ID: <CAFEAcA_ri8+bspkOhfmWu2fyPxomECZ2WPButBG6qOscBOWLZA@mail.gmail.com> (raw)
In-Reply-To: <20190308185932.4954-1-richard.henderson@linaro.org>
On Fri, 8 Mar 2019 at 19:00, Richard Henderson
<richard.henderson@linaro.org> wrote:
>
> We got away with eliding this check when target/hppa was user-only,
> but missed adding this check when adding system support.
>
> Fixes an early crash in the HP-UX 11 installer.
>
> Reported-by: Sven Schnelle <svens@stackframe.org>
> Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
> ---
> target/hppa/translate.c | 10 ++++------
> 1 file changed, 4 insertions(+), 6 deletions(-)
>
> diff --git a/target/hppa/translate.c b/target/hppa/translate.c
> index dc5636fe94..6c815e05c2 100644
> --- a/target/hppa/translate.c
> +++ b/target/hppa/translate.c
> @@ -816,12 +816,10 @@ static bool gen_illegal(DisasContext *ctx)
>
> static bool use_goto_tb(DisasContext *ctx, target_ureg dest)
> {
> - /* Suppress goto_tb in the case of single-steping and IO. */
> - if ((tb_cflags(ctx->base.tb) & CF_LAST_IO)
> - || ctx->base.singlestep_enabled) {
> - return false;
> - }
> - return true;
> + /* Suppress goto_tb for page crossing, IO, or single-steping. */
"stepping"
> + return !(((ctx->base.pc_first ^ dest) & TARGET_PAGE_MASK)
> + || (tb_cflags(ctx->base.tb) & CF_LAST_IO)
> + || ctx->base.singlestep_enabled);
> }
I note that (a) this isn't the way every other port phrases
the "same page" check -- they generally use something like
(ctx->base.tb->pc & TARGET_PAGE_MASK) == (dest & TARGET_PAGE_MASK)
and (b) the other ports generally keep that check inside an
ifndef CONFIG_USER_ONLY.
>
> /* If the next insn is to be nullified, and it's on the same page,
> --
> 2.17.2
thanks
-- PMM
next prev parent reply other threads:[~2019-03-08 19:04 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-03-08 18:59 [Qemu-devel] [PATCH] target/hppa: Check for page crossings in use_goto_tb Richard Henderson
2019-03-08 19:04 ` Peter Maydell [this message]
2019-03-08 19:15 ` Richard Henderson
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=CAFEAcA_ri8+bspkOhfmWu2fyPxomECZ2WPButBG6qOscBOWLZA@mail.gmail.com \
--to=peter.maydell@linaro.org \
--cc=qemu-devel@nongnu.org \
--cc=richard.henderson@linaro.org \
--cc=svens@stackframe.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).