From patchwork Sun Jan 6 18:31:31 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Andreas_F=C3=A4rber?= X-Patchwork-Id: 1937991 Return-Path: X-Original-To: patchwork-kvm@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork1.kernel.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by patchwork1.kernel.org (Postfix) with ESMTP id 94CCE3FED4 for ; Sun, 6 Jan 2013 18:32:01 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756130Ab3AFSbu (ORCPT ); Sun, 6 Jan 2013 13:31:50 -0500 Received: from cantor2.suse.de ([195.135.220.15]:55385 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756075Ab3AFSbr (ORCPT ); Sun, 6 Jan 2013 13:31:47 -0500 Received: from relay2.suse.de (unknown [195.135.220.254]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mx2.suse.de (Postfix) with ESMTP id 79ACAA51F6; Sun, 6 Jan 2013 19:31:46 +0100 (CET) From: =?UTF-8?q?Andreas=20F=C3=A4rber?= To: qemu-devel@nongnu.org Cc: agraf@suse.de, qemu-ppc@nongnu.org, =?UTF-8?q?Andreas=20F=C3=A4rber?= , Gleb Natapov (supporter:Overall), Marcelo Tosatti (supporter:Overall), kvm@vger.kernel.org (open list:Overall) Subject: [PATCH ppc-next v2 2/2] target-ppc: Error out for -cpu host on unknown PVR Date: Sun, 6 Jan 2013 19:31:31 +0100 Message-Id: <1357497091-30013-3-git-send-email-afaerber@suse.de> X-Mailer: git-send-email 1.7.10.4 In-Reply-To: <1357497091-30013-1-git-send-email-afaerber@suse.de> References: <1357497091-30013-1-git-send-email-afaerber@suse.de> MIME-Version: 1.0 Sender: kvm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org 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 --- target-ppc/kvm.c | 8 ++++++++ 1 Datei geändert, 8 Zeilen hinzugefügt(+) diff --git a/target-ppc/kvm.c b/target-ppc/kvm.c index a589575..b6b5a6a 100644 --- a/target-ppc/kvm.c +++ b/target-ppc/kvm.c @@ -1212,7 +1212,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)