hw/mips/malta: Do not initialize MT registers if MT ASE absent
authorPhilippe Mathieu-Daudé <f4bug@amsat.org>
Wed, 2 Dec 2020 17:53:09 +0000 (18:53 +0100)
committerPhilippe Mathieu-Daudé <f4bug@amsat.org>
Sun, 13 Dec 2020 19:26:02 +0000 (20:26 +0100)
Do not initialize MT-related config register if the MT ASE
is not present.

Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Message-Id: <20201204222622.2743175-5-f4bug@amsat.org>

hw/mips/malta.c

index 4651a1055c9dc9de861184c9db7889511d11916a..f06cb90a44adc54b969ae3ad64082167fe505ec7 100644 (file)
@@ -1135,8 +1135,10 @@ static void malta_mips_config(MIPSCPU *cpu)
     CPUMIPSState *env = &cpu->env;
     CPUState *cs = CPU(cpu);
 
-    env->mvp->CP0_MVPConf0 |= ((smp_cpus - 1) << CP0MVPC0_PVPE) |
+    if (ase_mt_available(env)) {
+        env->mvp->CP0_MVPConf0 |= ((smp_cpus - 1) << CP0MVPC0_PVPE) |
                          ((smp_cpus * cs->nr_threads - 1) << CP0MVPC0_PTC);
+    }
 }
 
 static void main_cpu_reset(void *opaque)