From 1b7ce68fb45b97a9eaf71eeb81d2b4f4ea6bf4b2 Mon Sep 17 00:00:00 2001 From: Andreas Färber Date: Sun, 6 Jan 2013 08:31:31 +0000 Subject: target-ppc: Error out for -cpu host on unknown PVR MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 Signed-off-by: Alexander Graf --- target-ppc/kvm.c | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'target-ppc') diff --git a/target-ppc/kvm.c b/target-ppc/kvm.c index ce7d69b403..4846acfc0d 100644 --- a/target-ppc/kvm.c +++ b/target-ppc/kvm.c @@ -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) -- cgit v1.2.3