qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Peter Maydell <peter.maydell@linaro.org>
To: Richard Henderson <richard.henderson@linaro.org>
Cc: QEMU Developers <qemu-devel@nongnu.org>
Subject: Re: [Qemu-devel] [PATCH 1/2] target/arm: Implement ARMv8.0-SB
Date: Tue, 26 Feb 2019 18:31:50 +0000	[thread overview]
Message-ID: <CAFEAcA9GW2HGGw1FjFSTOJgOn+eRs-1anQDJ7nb3FnOSNbQesQ@mail.gmail.com> (raw)
In-Reply-To: <20190220235017.1060-2-richard.henderson@linaro.org>

On Wed, 20 Feb 2019 at 23:50, Richard Henderson
<richard.henderson@linaro.org> wrote:
>
> Signed-off-by: Richard Henderson <richard.henderson@linaro.org>


> @@ -9192,6 +9192,17 @@ static void disas_arm_insn(DisasContext *s, unsigned int insn)
>                   */
>                  gen_goto_tb(s, 0, s->pc & ~1);
>                  return;
> +            case 7: /* sb */
> +                if (!dc_isar_feature(aa32_sb, s)) {
> +                    goto illegal_op;
> +                }
> +                /*
> +                 * TODO: There is no speculation barrier opcode
> +                 * for TCG; MB and end the TB instead.
> +                 */
> +                tcg_gen_mb(TCG_MO_ALL | TCG_BAR_SC);
> +                s->base.is_jmp = DISAS_TOO_MANY;

Why do we do the "end the TB" code differently here than we
do for the implementation of ISB in the case immediately
above ?

In the A32 encoding bits [3:0] are "(0)", so we should check that
they're 0 and UNDEF if not.


> +                return;
>              default:
>                  goto illegal_op;
>              }
> @@ -11810,6 +11821,17 @@ static void disas_thumb2_insn(DisasContext *s, uint32_t insn)
>                               */
>                              gen_goto_tb(s, 0, s->pc & ~1);
>                              break;
> +                        case 7: /* sb */
> +                            if (!dc_isar_feature(aa32_sb, s)) {
> +                                goto illegal_op;
> +                            }
> +                            /*
> +                             * TODO: There is no speculation barrier opcode
> +                             * for TCG; MB and end the TB instead.
> +                             */
> +                            tcg_gen_mb(TCG_MO_ALL | TCG_BAR_SC);
> +                            s->base.is_jmp = DISAS_TOO_MANY;

Similarly here: inconsistency about how we end the TB, and
not checking the [3:0] bits for being zero.

(We also I think are not fully decoding some of the other
sbz/sbo fields for insns in this group, but that's more of
an existing bug than a new one.)

> +                            break;
>                          default:
>                              goto illegal_op;
>                          }
> --
> 2.17.2

thanks
-- PMM

  reply	other threads:[~2019-02-26 18:32 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-02-20 23:50 [Qemu-devel] [PATCH 0/2] target/arm: SB and PredRes extensions Richard Henderson
2019-02-20 23:50 ` [Qemu-devel] [PATCH 1/2] target/arm: Implement ARMv8.0-SB Richard Henderson
2019-02-26 18:31   ` Peter Maydell [this message]
2019-02-28  1:18     ` Richard Henderson
2019-02-20 23:50 ` [Qemu-devel] [PATCH 2/2] target/arm: Implement ARMv8.0-PredRes Richard Henderson
2019-02-26 18:44   ` Peter Maydell
2019-02-26 18:52     ` Richard Henderson
2019-02-26 18:53       ` Peter Maydell

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=CAFEAcA9GW2HGGw1FjFSTOJgOn+eRs-1anQDJ7nb3FnOSNbQesQ@mail.gmail.com \
    --to=peter.maydell@linaro.org \
    --cc=qemu-devel@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).