Commit 62629d92bc for qemu.org

commit 62629d92bc88df0daff73e5a49a1696fdadf74d0
Author: Philippe Mathieu-Daudé <philmd@oss.qualcomm.com>
Date:   Thu Nov 12 05:55:04 2026 +0100

    target/mips: Fix reset into microMIPS mode when Config3.ISA is 3

    The Config3.ISA == 3 test ANDs bit 14 and bit 15 as two separate
    constants, so it is always false and no CPU resets into microMIPS
    mode.  Test the 2-bit field instead.

    Config3.ISA == 3: both MIPS32 and microMIPS32 are implemented, with
    microMIPS32 used out of reset (MD00090 rev 6.02, Table 9.67, p. 248).

    Fixes: 0bbc0396809f ("target/mips: Prevent switching mode Config3 ISA bit nanoMIPS")
    Signed-off-by: Philippe Mathieu-Daudé <philmd@oss.qualcomm.com>
    Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
    Message-ID: <20261113161158.25811-7-philmd@oss.qualcomm.com>

diff --git a/target/mips/cpu.c b/target/mips/cpu.c
index 8ad5e49ade..324e5989cc 100644
--- a/target/mips/cpu.c
+++ b/target/mips/cpu.c
@@ -459,7 +459,7 @@ static void mips_cpu_reset_hold(Object *obj, ResetType type)
         env->CP0_PWField = 0x02;
     }

-    if (env->CP0_Config3 & (1 << CP0C3_ISA) & (1 << (CP0C3_ISA + 1))) {
+    if (extract32(env->CP0_Config3, CP0C3_ISA, 2) == 3) {
         /*  microMIPS on reset when Config3.ISA is 3 */
         env->hflags |= MIPS_HFLAG_M16;
     }