[Qemu-devel] [PATCH] target-mips: Don't stop on [d]mtc0 DESAVE/KScratch

James Hogan posted 1 patch 6 years, 8 months ago
Patches applied successfully (tree, apply log)
git fetch https://github.com/patchew-project/qemu tags/patchew/1b88a351b0c447a2a4045a7d6979f62b4af96604.1501508116.git-series.james.hogan@imgtec.com
Test FreeBSD passed
Test checkpatch passed
Test docker passed
Test s390x passed
target/mips/translate.c | 4 ----
1 file changed, 0 insertions(+), 4 deletions(-)
[Qemu-devel] [PATCH] target-mips: Don't stop on [d]mtc0 DESAVE/KScratch
Posted by James Hogan 6 years, 8 months ago
Writing to the MIPS DESAVE register (and now the KScratch registers)
will stop translation, supposedly due to risk of execution mode
switches. However these registers are basically RW scratch registers
with no side effects so there is no risk of them triggering execution
mode changes.

Drop the bstate = BS_STOP for these registers for both mtc0 and dmtc0.

Fixes: 7a387fffce50 ("Add MIPS32R2 instructions, and generally straighten out the instruction decoding. This is also the first percent towards MIPS64 support.")
Signed-off-by: James Hogan <james.hogan@imgtec.com>
Cc: Aurelien Jarno <aurelien@aurel32.net>
Cc: Yongbok Kim <yongbok.kim@imgtec.com>
---
Changes in v2:
- Resend based on v2.10.0-rc0
---
 target/mips/translate.c | 4 ----
 1 file changed, 0 insertions(+), 4 deletions(-)

diff --git a/target/mips/translate.c b/target/mips/translate.c
index 51626aead32c..0bca700fb380 100644
--- a/target/mips/translate.c
+++ b/target/mips/translate.c
@@ -6386,8 +6386,6 @@ static void gen_mtc0(DisasContext *ctx, TCGv arg, int reg, int sel)
         default:
             goto cp0_unimplemented;
         }
-        /* Stop translation as we may have switched the execution mode */
-        ctx->bstate = BS_STOP;
         break;
     default:
        goto cp0_unimplemented;
@@ -7714,8 +7712,6 @@ static void gen_dmtc0(DisasContext *ctx, TCGv arg, int reg, int sel)
         default:
             goto cp0_unimplemented;
         }
-        /* Stop translation as we may have switched the execution mode */
-        ctx->bstate = BS_STOP;
         break;
     default:
         goto cp0_unimplemented;
-- 
git-series 0.8.10