]> git.proxmox.com Git - qemu.git/commitdiff
target-ppc: Error out for -cpu host on unknown PVR
authorAndreas Färber <afaerber@suse.de>
Sun, 6 Jan 2013 08:31:31 +0000 (08:31 +0000)
committerAlexander Graf <agraf@suse.de>
Mon, 7 Jan 2013 16:37:11 +0000 (17:37 +0100)
Previously we silently exited, with subclasses we got an opcode warning.
Instead, explicitly tell the user what's wrong.

An indication for this is -cpu ? showing "host" with an all-zero PVR.

Signed-off-by: Andreas Färber <afaerber@suse.de>
Signed-off-by: Alexander Graf <agraf@suse.de>
target-ppc/kvm.c

index ce7d69b403eb8756227291dc478201c0e0ab6beb..4846acfc0d6414d305ba41bf5e0935a2033886be 100644 (file)
@@ -1232,7 +1232,15 @@ static void alter_insns(uint64_t *word, uint64_t flags, bool on)
 
 static void kvmppc_host_cpu_initfn(Object *obj)
 {
+    PowerPCCPUClass *pcc = POWERPC_CPU_GET_CLASS(obj);
+
     assert(kvm_enabled());
+
+    if (pcc->info->pvr != mfpvr()) {
+        fprintf(stderr, "Your host CPU is unsupported.\n"
+                "Please choose a supported model instead, see -cpu ?.\n");
+        exit(1);
+    }
 }
 
 static void kvmppc_host_cpu_class_init(ObjectClass *oc, void *data)