From patchwork Thu Feb 25 03:02:10 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: David Gibson X-Patchwork-Id: 8417321 Return-Path: X-Original-To: patchwork-qemu-devel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id E4B179F372 for ; Thu, 25 Feb 2016 03:01:35 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 48A4C2028D for ; Thu, 25 Feb 2016 03:01:35 +0000 (UTC) Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 4B03A20279 for ; Thu, 25 Feb 2016 03:01:34 +0000 (UTC) Received: from localhost ([::1]:39700 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aYmBJ-0007zH-EM for patchwork-qemu-devel@patchwork.kernel.org; Wed, 24 Feb 2016 22:01:33 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:58819) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aYmB9-0007yv-5X for qemu-devel@nongnu.org; Wed, 24 Feb 2016 22:01:24 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aYmB8-0006N9-6k for qemu-devel@nongnu.org; Wed, 24 Feb 2016 22:01:23 -0500 Received: from ozlabs.org ([2401:3900:2:1::2]:59446) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aYmB7-0006N1-CU; Wed, 24 Feb 2016 22:01:22 -0500 Received: by ozlabs.org (Postfix, from userid 1007) id D264E140C44; Thu, 25 Feb 2016 14:01:17 +1100 (AEDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gibson.dropbear.id.au; s=201602; t=1456369277; bh=7RnOHUdCgJ1ugBL2iWpzui9E+KftFVYWz0c6U4/zYHE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=do0P313vuZaHhQnMSpp2IIFhfz2nyYVNlnk61RSUmPKema4UBLoLBpiot329C691L +urfEmVpOtuQAxZ0kLdIdYCpJjusXxhW2ZLJJybUn604WyS95N4X9bMqggmlfJBzE6 FxVlcBrVDJbP8Mll2PqONS5uhf6BKQGLSOU5neN4= From: David Gibson To: peter.maydell@linaro.org, agraf@suse.de Date: Thu, 25 Feb 2016 14:02:10 +1100 Message-Id: <1456369330-7294-6-git-send-email-david@gibson.dropbear.id.au> X-Mailer: git-send-email 2.5.0 In-Reply-To: <1456369330-7294-1-git-send-email-david@gibson.dropbear.id.au> References: <1456369330-7294-1-git-send-email-david@gibson.dropbear.id.au> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2401:3900:2:1::2 Cc: Thomas Huth , aik@ozlabs.ru, mdroth@linux.vnet.ibm.com, qemu-devel@nongnu.org, qemu-ppc@nongnu.org, David Gibson Subject: [Qemu-devel] [PULL 5/5] ppc/kvm: Tell the user what might be wrong when using bad CPU types with kvm-hv X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org X-Spam-Status: No, score=-6.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI, T_DKIM_INVALID, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Thomas Huth Using a CPU type that does not match the host is not possible when using the kvm-hv kernel module - the PVR is checked in the kernel function kvm_arch_vcpu_ioctl_set_sregs_hv() and rejected with -EINVAL if it does not match the host. However, when the user tries to specify a non-matching CPU type, QEMU currently only reports "kvm_init_vcpu failed: Invalid argument", and this is of course not very helpful for the user to solve the problem. So this patch adds a more descriptive error message that tells the user to specify "-cpu host" instead. Signed-off-by: Thomas Huth [Removed melodramatic '!' :)] Signed-off-by: David Gibson --- target-ppc/kvm.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/target-ppc/kvm.c b/target-ppc/kvm.c index 762d6cf..d67c169 100644 --- a/target-ppc/kvm.c +++ b/target-ppc/kvm.c @@ -513,6 +513,10 @@ int kvm_arch_init_vcpu(CPUState *cs) /* Synchronize sregs with kvm */ ret = kvm_arch_sync_sregs(cpu); if (ret) { + if (ret == -EINVAL) { + error_report("Register sync failed... If you're using kvm-hv.ko," + " only \"-cpu host\" is possible"); + } return ret; }