qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: "Philippe Mathieu-Daudé" <f4bug@amsat.org>
To: qemu-devel@nongnu.org
Cc: "Aleksandar Rikalo" <aleksandar.rikalo@syrmia.com>,
	"Jia Liu" <proljc@gmail.com>,
	"Richard Henderson" <richard.henderson@linaro.org>,
	"Philippe Mathieu-Daudé" <f4bug@amsat.org>,
	"Aurelien Jarno" <aurelien@aurel32.net>
Subject: [PULL 04/15] target/mips: Raise exception when DINSV opcode used with DSP disabled
Date: Fri, 25 Jun 2021 11:23:18 +0200	[thread overview]
Message-ID: <20210625092329.1529100-5-f4bug@amsat.org> (raw)
In-Reply-To: <20210625092329.1529100-1-f4bug@amsat.org>

Per the "MIPS® DSP Module for MIPS64 Architecture" manual, rev. 3.02,
Table 5.3 "SPECIAL3 Encoding of Function Field for DSP Module":

  If the Module/ASE is not implemented, executing such an instruction
  must cause a Reserved Instruction Exception.

The DINSV instruction lists the following exceptions:
- Reserved Instruction
- DSP Disabled

If the MIPS core doesn't support the DSP module, or the DSP is
disabled, do not handle the '$rt = $0' case as a no-op but raise
the proper exception instead.

Cc: Jia Liu <proljc@gmail.com>
Fixes: 1cb6686cf92 ("target-mips: Add ASE DSP bit/manipulation instructions")
Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Message-Id: <20210529165443.1114402-1-f4bug@amsat.org>
---
 target/mips/tcg/translate.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/target/mips/tcg/translate.c b/target/mips/tcg/translate.c
index 09b19262c8c..3fd0c48d772 100644
--- a/target/mips/tcg/translate.c
+++ b/target/mips/tcg/translate.c
@@ -24379,10 +24379,11 @@ static void decode_opc_special3_legacy(CPUMIPSState *env, DisasContext *ctx)
         {
             TCGv t0, t1;
 
+            check_dsp(ctx);
+
             if (rt == 0) {
                 break;
             }
-            check_dsp(ctx);
 
             t0 = tcg_temp_new();
             t1 = tcg_temp_new();
-- 
2.31.1



  parent reply	other threads:[~2021-06-25  9:51 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-06-25  9:23 [PULL 00/15] MIPS patches for 2021-06-25 Philippe Mathieu-Daudé
2021-06-25  9:23 ` [PULL 01/15] target/mips: Fix potential integer overflow (CID 1452921) Philippe Mathieu-Daudé
2021-06-25  9:23 ` [PULL 02/15] target/mips: Fix TCG temporary leaks in gen_pool32a5_nanomips_insn() Philippe Mathieu-Daudé
2021-06-25  9:23 ` [PULL 03/15] target/mips: Fix more TCG temporary leaks in gen_pool32a5_nanomips_insn Philippe Mathieu-Daudé
2021-06-25  9:23 ` Philippe Mathieu-Daudé [this message]
2021-06-25  9:23 ` [PULL 05/15] target/mips: Do not abort on invalid instruction Philippe Mathieu-Daudé
2021-06-25  9:23 ` [PULL 06/15] target/mips: Move TCG trace events to tcg/ sub directory Philippe Mathieu-Daudé
2021-06-25  9:23 ` [PULL 07/15] target/mips: Move translate.h " Philippe Mathieu-Daudé
2021-06-25  9:23 ` [PULL 08/15] target/mips: Restrict some system specific declarations to sysemu Philippe Mathieu-Daudé
2021-06-25  9:23 ` [PULL 09/15] target/mips: Remove SmartMIPS / MDMX unuseful comments Philippe Mathieu-Daudé
2021-06-25  9:23 ` [PULL 10/15] target/mips: Remove microMIPS BPOSGE32 / BPOSGE64 unuseful cases Philippe Mathieu-Daudé
2021-06-25  9:23 ` [PULL 11/15] target/mips: fix emulation of nanoMIPS BPOSGE32 instruction Philippe Mathieu-Daudé
2021-06-25  9:23 ` [PULL 12/15] target/mips: Constify host_to_mips_errno[] Philippe Mathieu-Daudé
2021-06-25  9:23 ` [PULL 13/15] target/mips: Optimize regnames[] arrays Philippe Mathieu-Daudé
2021-06-25  9:23 ` [PULL 14/15] target/mips: Remove pointless gen_msa() Philippe Mathieu-Daudé
2021-06-25  9:23 ` [PULL 15/15] target/mips: Merge msa32/msa64 decodetree definitions Philippe Mathieu-Daudé
2021-06-28 13:00 ` [PULL 00/15] MIPS patches for 2021-06-25 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=20210625092329.1529100-5-f4bug@amsat.org \
    --to=f4bug@amsat.org \
    --cc=aleksandar.rikalo@syrmia.com \
    --cc=aurelien@aurel32.net \
    --cc=proljc@gmail.com \
    --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).