qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Richard Henderson <rth@twiddle.net>
To: gang.chen.5i5j@gmail.com, peter.maydell@linaro.org
Cc: cmetcalf@ezchip.com, qemu-devel@nongnu.org, xili_gchen_5257@hotmail.com
Subject: Re: [Qemu-devel] [PATCH] target-tilegx: Check zero dest register for ld instructions
Date: Thu, 1 Oct 2015 12:29:52 +1000	[thread overview]
Message-ID: <560C9AA0.6010206@twiddle.net> (raw)
In-Reply-To: <1443448287-4433-1-git-send-email-gang.chen.5i5j@gmail.com>

On 09/28/2015 11:51 PM, gang.chen.5i5j@gmail.com wrote:
> From: Chen Gang <gang.chen.5i5j@gmail.com>
>
> At present, qemu x86_64 host backend can not remove the related dummy
> instructions. Even the worse, sometimes, it will generate the incorrect
> instructions which will cause segment fault for prefetch_l3 instruction.
>
> Signed-off-by: Chen Gang <gang.chen.5i5j@gmail.com>
> ---
>   target-tilegx/translate.c | 10 +++++++---
>   1 file changed, 7 insertions(+), 3 deletions(-)
>
> diff --git a/target-tilegx/translate.c b/target-tilegx/translate.c
> index 86da6b5..7232361 100644
> --- a/target-tilegx/translate.c
> +++ b/target-tilegx/translate.c
> @@ -620,7 +620,9 @@ static TileExcp gen_rr_opcode(DisasContext *dc, unsigned opext,
>           memop = MO_TEQ;
>           mnemonic = "ld";
>       do_load:
> -        tcg_gen_qemu_ld_tl(tdest, tsrca, dc->mmuidx, memop);
> +        if (dest != TILEGX_R_ZERO) {
> +            tcg_gen_qemu_ld_tl(tdest, tsrca, dc->mmuidx, memop);
> +        }

This isn't right.  Not all load instructions are nofault prefetches.


r~


>           break;
>       case OE_RR_X1(LDNA):
>           tcg_gen_andi_tl(tdest, tsrca, ~7);
> @@ -1987,8 +1989,10 @@ static TileExcp decode_y2(DisasContext *dc, tilegx_bundle_bits bundle)
>           memop = MO_TEQ;
>           mnemonic = "ld";
>       do_load:
> -        tcg_gen_qemu_ld_tl(dest_gr(dc, srcbdest), load_gr(dc, srca),
> -                           dc->mmuidx, memop);
> +        if (srcbdest != TILEGX_R_ZERO) {
> +            tcg_gen_qemu_ld_tl(dest_gr(dc, srcbdest), load_gr(dc, srca),
> +                               dc->mmuidx, memop);
> +        }
>           qemu_log_mask(CPU_LOG_TB_IN_ASM, "%s %s, %s", mnemonic,
>                         reg_names[srcbdest], reg_names[srca]);
>           return TILEGX_EXCP_NONE;
>

  reply	other threads:[~2015-10-01  2:30 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-09-28 13:51 [Qemu-devel] [PATCH] target-tilegx: Check zero dest register for ld instructions gang.chen.5i5j
2015-10-01  2:29 ` Richard Henderson [this message]
     [not found]   ` <560D0CBD.4050202@hotmail.com>
2015-10-01 10:35     ` Chen Gang

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=560C9AA0.6010206@twiddle.net \
    --to=rth@twiddle.net \
    --cc=cmetcalf@ezchip.com \
    --cc=gang.chen.5i5j@gmail.com \
    --cc=peter.maydell@linaro.org \
    --cc=qemu-devel@nongnu.org \
    --cc=xili_gchen_5257@hotmail.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).