From mboxrd@z Thu Jan 1 00:00:00 1970 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 From: David Gibson Date: Thu, 25 Feb 2016 14:02:10 +1100 Message-Id: <1456369330-7294-6-git-send-email-david@gibson.dropbear.id.au> 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> Subject: [Qemu-devel] [PULL 5/5] ppc/kvm: Tell the user what might be wrong when using bad CPU types with kvm-hv List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: peter.maydell@linaro.org, agraf@suse.de Cc: Thomas Huth , aik@ozlabs.ru, mdroth@linux.vnet.ibm.com, qemu-devel@nongnu.org, qemu-ppc@nongnu.org, David Gibson 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; } -- 2.5.0