Commit 63931bc189 for qemu.org

commit 63931bc18951354a2b4e6515630a5f413dab74a3
Author: Philippe Mathieu-Daudé <philmd@oss.qualcomm.com>
Date:   Fri Nov 13 09:13:30 2026 +0100

    target/mips: Require the MT module for MFTR/MTTR

    MFTR/MTTR must raise Reserved Instruction on processors not
    implementing the MT module (MD00378 pp.46/50, Config3.MT:
    table 6.21). Use check_cp0_mt(), as done for the other MT
    instructions, instead of only check_cp0_enabled().

    Fixes: ead9360e2fbc ("Partial support for 34K multithreading")
    Signed-off-by: Philippe Mathieu-Daudé <philmd@oss.qualcomm.com>
    Message-ID: <20261113161158.25811-4-philmd@oss.qualcomm.com>

diff --git a/target/mips/tcg/translate.c b/target/mips/tcg/translate.c
index 6e7e1a0f75..c434da714b 100644
--- a/target/mips/tcg/translate.c
+++ b/target/mips/tcg/translate.c
@@ -8588,7 +8588,7 @@ static void gen_cp0(CPUMIPSState *env, DisasContext *ctx, uint32_t opc,
         opn = "mthc0";
         break;
     case OPC_MFTR:
-        check_cp0_enabled(ctx);
+        check_cp0_mt(ctx);
         if (rd == 0) {
             /* Treat as NOP. */
             return;
@@ -8598,7 +8598,7 @@ static void gen_cp0(CPUMIPSState *env, DisasContext *ctx, uint32_t opc,
         opn = "mftr";
         break;
     case OPC_MTTR:
-        check_cp0_enabled(ctx);
+        check_cp0_mt(ctx);
         gen_mttr(env, ctx, rd, rt, (ctx->opcode >> 5) & 1,
                  ctx->opcode & 0x7, (ctx->opcode >> 4) & 1);
         opn = "mttr";