From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:59091) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Z0tLv-0001av-C1 for qemu-devel@nongnu.org; Fri, 05 Jun 2015 11:16:12 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Z0tLu-0007Ag-7k for qemu-devel@nongnu.org; Fri, 05 Jun 2015 11:16:11 -0400 Received: from mx1.redhat.com ([209.132.183.28]:52375) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Z0tLu-0007AF-1g for qemu-devel@nongnu.org; Fri, 05 Jun 2015 11:16:10 -0400 Received: from int-mx09.intmail.prod.int.phx2.redhat.com (int-mx09.intmail.prod.int.phx2.redhat.com [10.5.11.22]) by mx1.redhat.com (Postfix) with ESMTPS id BED2C3627D6 for ; Fri, 5 Jun 2015 15:16:09 +0000 (UTC) From: Paolo Bonzini Date: Fri, 5 Jun 2015 17:15:03 +0200 Message-Id: <1433517363-32335-3-git-send-email-pbonzini@redhat.com> In-Reply-To: <1433517363-32335-1-git-send-email-pbonzini@redhat.com> References: <1433517363-32335-1-git-send-email-pbonzini@redhat.com> Subject: [Qemu-devel] [PULL 02/62] ppc: add helpful message when KVM fails to start VCPU List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: Laurent Vivier From: Laurent Vivier On POWER8 systems, KVM checks if VCPU is running on primary threads, and that secondary threads are offline. If this is not the case, ioctl() fails with errno set to EBUSY. QEMU aborts with a non explicit error message: $ ./qemu-system-ppc64 --nographic -machine pseries,accel=kvm error: kvm run failed Device or resource busy To help user to diagnose the problem, this patch adds an informative error message. There is no easy way to check if SMT is enabled before starting the VCPU, and as this case is the only one setting errno to EBUSY, we just check the errno value to display a message. Signed-off-by: Laurent Vivier Message-Id: <1431976007-20503-1-git-send-email-lvivier@redhat.com> Signed-off-by: Paolo Bonzini --- kvm-all.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/kvm-all.c b/kvm-all.c index b2b1bc3..44a34a5 100644 --- a/kvm-all.c +++ b/kvm-all.c @@ -1828,6 +1828,14 @@ int kvm_cpu_exec(CPUState *cpu) } fprintf(stderr, "error: kvm run failed %s\n", strerror(-run_ret)); +#ifdef TARGET_PPC + if (run_ret == -EBUSY) { + fprintf(stderr, + "This is probably because your SMT is enabled.\n" + "VCPU can only run on primary threads with all " + "secondary threads offline.\n"); + } +#endif ret = -1; break; } -- 2.4.1