All of lore.kernel.org
 help / color / mirror / Atom feed
* [Qemu-devel] [Bug 1071149] [NEW] target-mips: special3 instruction dinsm translation error
@ 2012-10-25  6:31 Nikita Kanunnikov
  2012-10-25  7:57 ` [Qemu-devel] [Bug 1071149] " Aurelien Jarno
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: Nikita Kanunnikov @ 2012-10-25  6:31 UTC (permalink / raw)
  To: qemu-devel

Public bug reported:

Function decode_opc() in translate.c calls function gen_bitops(), which
has such prototype:

/* special3 bitfield operations */
static void gen_bitops (DisasContext *ctx, uint32_t opc, int rt,
                        int rs, int lsb, int msb)

The code for DINSM instruction is:

case OPC_DINSM ... OPC_DINS:
            check_insn(env, ctx, ISA_MIPS64R2);
            check_mips_64(ctx);
            gen_bitops(ctx, op1, rt, rs, sa, rd);
            break;

But rd ≠ msb according to MIPS64R2 standard, rd = msb - 32.

** Affects: qemu
     Importance: Undecided
         Status: New

-- 
You received this bug notification because you are a member of qemu-
devel-ml, which is subscribed to QEMU.
https://bugs.launchpad.net/bugs/1071149

Title:
  target-mips: special3 instruction dinsm translation error

Status in QEMU:
  New

Bug description:
  Function decode_opc() in translate.c calls function gen_bitops(),
  which has such prototype:

  /* special3 bitfield operations */
  static void gen_bitops (DisasContext *ctx, uint32_t opc, int rt,
                          int rs, int lsb, int msb)

  The code for DINSM instruction is:

  case OPC_DINSM ... OPC_DINS:
              check_insn(env, ctx, ISA_MIPS64R2);
              check_mips_64(ctx);
              gen_bitops(ctx, op1, rt, rs, sa, rd);
              break;

  But rd ≠ msb according to MIPS64R2 standard, rd = msb - 32.

To manage notifications about this bug go to:
https://bugs.launchpad.net/qemu/+bug/1071149/+subscriptions

^ permalink raw reply	[flat|nested] 5+ messages in thread

* [Qemu-devel] [Bug 1071149] Re: target-mips: special3 instruction dinsm translation error
  2012-10-25  6:31 [Qemu-devel] [Bug 1071149] [NEW] target-mips: special3 instruction dinsm translation error Nikita Kanunnikov
@ 2012-10-25  7:57 ` Aurelien Jarno
  2012-10-25  9:51 ` Aurelien Jarno
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 5+ messages in thread
From: Aurelien Jarno @ 2012-10-25  7:57 UTC (permalink / raw)
  To: qemu-devel

That's why in gen_bitops() does later:

    case OPC_DINSM:
        if (lsb > msb)
            goto fail;
        mask = ((msb - lsb + 1 + 32 < 64) ? ((1ULL << (msb - lsb + 1 + 32)) - 1) : ~0ULL) << lsb;

...

    case OPC_DINSU:
        if (lsb > msb)
            goto fail;
        mask = ((1ULL << (msb - lsb + 1)) - 1) << (lsb + 32);

...

    case OPC_DINS:
        if (lsb > msb)
            goto fail;
        gen_load_gpr(t0, rt);
        mask = ((1ULL << (msb - lsb + 1)) - 1) << lsb;

For me there is no bug there, but if you believe the contrary, please
send a testcase.

** Changed in: qemu
       Status: New => Invalid

-- 
You received this bug notification because you are a member of qemu-
devel-ml, which is subscribed to QEMU.
https://bugs.launchpad.net/bugs/1071149

Title:
  target-mips: special3 instruction dinsm translation error

Status in QEMU:
  Invalid

Bug description:
  Function decode_opc() in translate.c calls function gen_bitops(),
  which has such prototype:

  /* special3 bitfield operations */
  static void gen_bitops (DisasContext *ctx, uint32_t opc, int rt,
                          int rs, int lsb, int msb)

  The code for DINSM instruction is:

  case OPC_DINSM ... OPC_DINS:
              check_insn(env, ctx, ISA_MIPS64R2);
              check_mips_64(ctx);
              gen_bitops(ctx, op1, rt, rs, sa, rd);
              break;

  But rd ≠ msb according to MIPS64R2 standard, rd = msb - 32.

To manage notifications about this bug go to:
https://bugs.launchpad.net/qemu/+bug/1071149/+subscriptions

^ permalink raw reply	[flat|nested] 5+ messages in thread

* [Qemu-devel] [Bug 1071149] Re: target-mips: special3 instruction dinsm translation error
  2012-10-25  6:31 [Qemu-devel] [Bug 1071149] [NEW] target-mips: special3 instruction dinsm translation error Nikita Kanunnikov
  2012-10-25  7:57 ` [Qemu-devel] [Bug 1071149] " Aurelien Jarno
@ 2012-10-25  9:51 ` Aurelien Jarno
  2012-10-31 21:58 ` Aurelien Jarno
  2013-05-20 17:34 ` Aurelien Jarno
  3 siblings, 0 replies; 5+ messages in thread
From: Aurelien Jarno @ 2012-10-25  9:51 UTC (permalink / raw)
  To: qemu-devel

Indeed the  (lsb > msb) case is wrong and should be removed. I'll post a
patch about that later this week.

** Changed in: qemu
       Status: Invalid => Confirmed

-- 
You received this bug notification because you are a member of qemu-
devel-ml, which is subscribed to QEMU.
https://bugs.launchpad.net/bugs/1071149

Title:
  target-mips: special3 instruction dinsm translation error

Status in QEMU:
  Confirmed

Bug description:
  Function decode_opc() in translate.c calls function gen_bitops(),
  which has such prototype:

  /* special3 bitfield operations */
  static void gen_bitops (DisasContext *ctx, uint32_t opc, int rt,
                          int rs, int lsb, int msb)

  The code for DINSM instruction is:

  case OPC_DINSM ... OPC_DINS:
              check_insn(env, ctx, ISA_MIPS64R2);
              check_mips_64(ctx);
              gen_bitops(ctx, op1, rt, rs, sa, rd);
              break;

  But rd ≠ msb according to MIPS64R2 standard, rd = msb - 32.

To manage notifications about this bug go to:
https://bugs.launchpad.net/qemu/+bug/1071149/+subscriptions

^ permalink raw reply	[flat|nested] 5+ messages in thread

* [Qemu-devel] [Bug 1071149] Re: target-mips: special3 instruction dinsm translation error
  2012-10-25  6:31 [Qemu-devel] [Bug 1071149] [NEW] target-mips: special3 instruction dinsm translation error Nikita Kanunnikov
  2012-10-25  7:57 ` [Qemu-devel] [Bug 1071149] " Aurelien Jarno
  2012-10-25  9:51 ` Aurelien Jarno
@ 2012-10-31 21:58 ` Aurelien Jarno
  2013-05-20 17:34 ` Aurelien Jarno
  3 siblings, 0 replies; 5+ messages in thread
From: Aurelien Jarno @ 2012-10-31 21:58 UTC (permalink / raw)
  To: qemu-devel

Fixed in commit e0d002f17d1db1ade2b8d24b4a7c7ab361256726

** Changed in: qemu
       Status: Confirmed => Fix Committed

-- 
You received this bug notification because you are a member of qemu-
devel-ml, which is subscribed to QEMU.
https://bugs.launchpad.net/bugs/1071149

Title:
  target-mips: special3 instruction dinsm translation error

Status in QEMU:
  Fix Committed

Bug description:
  Function decode_opc() in translate.c calls function gen_bitops(),
  which has such prototype:

  /* special3 bitfield operations */
  static void gen_bitops (DisasContext *ctx, uint32_t opc, int rt,
                          int rs, int lsb, int msb)

  The code for DINSM instruction is:

  case OPC_DINSM ... OPC_DINS:
              check_insn(env, ctx, ISA_MIPS64R2);
              check_mips_64(ctx);
              gen_bitops(ctx, op1, rt, rs, sa, rd);
              break;

  But rd ≠ msb according to MIPS64R2 standard, rd = msb - 32.

To manage notifications about this bug go to:
https://bugs.launchpad.net/qemu/+bug/1071149/+subscriptions

^ permalink raw reply	[flat|nested] 5+ messages in thread

* [Qemu-devel] [Bug 1071149] Re: target-mips: special3 instruction dinsm translation error
  2012-10-25  6:31 [Qemu-devel] [Bug 1071149] [NEW] target-mips: special3 instruction dinsm translation error Nikita Kanunnikov
                   ` (2 preceding siblings ...)
  2012-10-31 21:58 ` Aurelien Jarno
@ 2013-05-20 17:34 ` Aurelien Jarno
  3 siblings, 0 replies; 5+ messages in thread
From: Aurelien Jarno @ 2013-05-20 17:34 UTC (permalink / raw)
  To: qemu-devel

** Changed in: qemu
       Status: Fix Committed => Fix Released

-- 
You received this bug notification because you are a member of qemu-
devel-ml, which is subscribed to QEMU.
https://bugs.launchpad.net/bugs/1071149

Title:
  target-mips: special3 instruction dinsm translation error

Status in QEMU:
  Fix Released

Bug description:
  Function decode_opc() in translate.c calls function gen_bitops(),
  which has such prototype:

  /* special3 bitfield operations */
  static void gen_bitops (DisasContext *ctx, uint32_t opc, int rt,
                          int rs, int lsb, int msb)

  The code for DINSM instruction is:

  case OPC_DINSM ... OPC_DINS:
              check_insn(env, ctx, ISA_MIPS64R2);
              check_mips_64(ctx);
              gen_bitops(ctx, op1, rt, rs, sa, rd);
              break;

  But rd ≠ msb according to MIPS64R2 standard, rd = msb - 32.

To manage notifications about this bug go to:
https://bugs.launchpad.net/qemu/+bug/1071149/+subscriptions

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2013-05-20 17:41 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-10-25  6:31 [Qemu-devel] [Bug 1071149] [NEW] target-mips: special3 instruction dinsm translation error Nikita Kanunnikov
2012-10-25  7:57 ` [Qemu-devel] [Bug 1071149] " Aurelien Jarno
2012-10-25  9:51 ` Aurelien Jarno
2012-10-31 21:58 ` Aurelien Jarno
2013-05-20 17:34 ` Aurelien Jarno

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.