]> git.proxmox.com Git - mirror_qemu.git/commitdiff
target-ppc: Add MMU model check for booke machines
authorValentin Plotkin <caliborn@sdf.org>
Thu, 26 Jan 2017 10:15:59 +0000 (10:15 +0000)
committerDavid Gibson <david@gibson.dropbear.id.au>
Wed, 1 Feb 2017 22:30:06 +0000 (09:30 +1100)
Machines bamboo, e500 and virtex-ml507 assume a certain MMU model,
otherwise resulting in unpredictable behavior. Add apropriate checks
into *_init functions.

Signed-off-by: Valentin Plotkin <caliborn@sdf.org>
[regarding virtex parts]
Reviewed-by: Edgar E. Iglesias <edgar.iglesias@xilinx.com>
Tested-by: Edgar E. Iglesias <edgar.iglesias@xilinx.com>
Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
hw/ppc/e500.c
hw/ppc/ppc440_bamboo.c
hw/ppc/virtex_ml507.c

index 792bd79d393f2357f0772855db6a0400d384bd31..f7df2388c1e52f8ef26f425580b4469d7ec39c48 100644 (file)
@@ -827,6 +827,12 @@ void ppce500_init(MachineState *machine, PPCE500Params *params)
         env = &cpu->env;
         cs = CPU(cpu);
 
+        if (env->mmu_model != POWERPC_MMU_BOOKE206) {
+            fprintf(stderr, "MMU model %i not supported by this machine.\n",
+                env->mmu_model);
+            exit(1);
+        }
+
         if (!firstenv) {
             firstenv = env;
         }
index 5c535b18a20d066787eced12b2a61ce61ed48872..9d997bf74335b4509b4c159978b8658f3329b5d2 100644 (file)
@@ -193,6 +193,12 @@ static void bamboo_init(MachineState *machine)
     }
     env = &cpu->env;
 
+    if (env->mmu_model != POWERPC_MMU_BOOKE) {
+        fprintf(stderr, "MMU model %i not supported by this machine.\n",
+            env->mmu_model);
+        exit(1);
+    }
+
     qemu_register_reset(main_cpu_reset, cpu);
     ppc_booke_timers_init(cpu, 400000000, 0);
     ppc_dcr_init(env, NULL, NULL);
index b97d96685cf1f74b610898238bef879767113516..fdbcf22a0cae917a3d4cf1778cfb72681f6f104d 100644 (file)
@@ -221,6 +221,13 @@ static void virtex_init(MachineState *machine)
 
     cpu = ppc440_init_xilinx(&ram_size, 1, machine->cpu_model, 400000000);
     env = &cpu->env;
+
+    if (env->mmu_model != POWERPC_MMU_BOOKE) {
+        fprintf(stderr, "MMU model %i not supported by this machine.\n",
+            env->mmu_model);
+        exit(1);
+    }
+
     qemu_register_reset(main_cpu_reset, cpu);
 
     memory_region_allocate_system_memory(phys_ram, NULL, "ram", ram_size);