From patchwork Thu May 26 14:31:25 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Cole Robinson X-Patchwork-Id: 9137039 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id B475B6075A for ; Thu, 26 May 2016 14:32:47 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id A7B1628066 for ; Thu, 26 May 2016 14:32:47 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 99E58282F5; Thu, 26 May 2016 14:32:47 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=2.0 tests=BAYES_00,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 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.wl.linuxfoundation.org (Postfix) with ESMTPS id 4A7CF28066 for ; Thu, 26 May 2016 14:32:47 +0000 (UTC) Received: from localhost ([::1]:38676 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1b5wL8-0004fw-G7 for patchwork-qemu-devel@patchwork.kernel.org; Thu, 26 May 2016 10:32:46 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:46662) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1b5wKh-0004bl-6T for qemu-devel@nongnu.org; Thu, 26 May 2016 10:32:24 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1b5wKf-00086I-3O for qemu-devel@nongnu.org; Thu, 26 May 2016 10:32:18 -0400 Received: from mx1.redhat.com ([209.132.183.28]:57089) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1b5wKX-00082t-T5; Thu, 26 May 2016 10:32:09 -0400 Received: from int-mx13.intmail.prod.int.phx2.redhat.com (int-mx13.intmail.prod.int.phx2.redhat.com [10.5.11.26]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id C40A86317C; Thu, 26 May 2016 14:32:08 +0000 (UTC) Received: from colepc.redhat.com (ovpn-116-13.phx2.redhat.com [10.3.116.13]) by int-mx13.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id u4QEW7Yb003640; Thu, 26 May 2016 10:32:08 -0400 From: Cole Robinson To: qemu-devel@nongnu.org Date: Thu, 26 May 2016 10:31:25 -0400 Message-Id: X-Scanned-By: MIMEDefang 2.68 on 10.5.11.26 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.38]); Thu, 26 May 2016 14:32:08 +0000 (UTC) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PATCH] hw/arm/virt: Reject gic-version=host for non-KVM X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: peter.maydell@linaro.org, qemu-arm@nongnu.org, Cole Robinson Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" X-Virus-Scanned: ClamAV using ClamSMTP If you try to gic-version=host with TCG on a KVM aarch64 host, qemu segfaults, since host requires KVM APIs. Explicitly reject gic-version=host if KVM is not enabled https://bugzilla.redhat.com/show_bug.cgi?id=1339977 Signed-off-by: Cole Robinson --- hw/arm/virt.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/hw/arm/virt.c b/hw/arm/virt.c index e77ed88..1e82597 100644 --- a/hw/arm/virt.c +++ b/hw/arm/virt.c @@ -1122,10 +1122,14 @@ static void machvirt_init(MachineState *machine) * KVM is not available yet */ if (!gic_version) { + if (!kvm_enabled()) { + error_report("gic-version=host requires KVM"); + exit(1); + } + gic_version = kvm_arm_vgic_probe(); if (!gic_version) { error_report("Unable to determine GIC version supported by host"); - error_printf("KVM acceleration is probably not supported\n"); exit(1); } }