From patchwork Thu Feb 1 17:28:08 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Wei Huang X-Patchwork-Id: 10195733 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 18DC360247 for ; Thu, 1 Feb 2018 17:30:54 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 0D4F928B65 for ; Thu, 1 Feb 2018 17:30:54 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 000A028B68; Thu, 1 Feb 2018 17:30:53 +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 8815D28B65 for ; Thu, 1 Feb 2018 17:30:53 +0000 (UTC) Received: from localhost ([::1]:49722 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ehIhI-0004qm-M0 for patchwork-qemu-devel@patchwork.kernel.org; Thu, 01 Feb 2018 12:30:52 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:38516) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ehIfc-00034z-9z for qemu-devel@nongnu.org; Thu, 01 Feb 2018 12:29:09 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ehIfb-0005Om-DQ for qemu-devel@nongnu.org; Thu, 01 Feb 2018 12:29:08 -0500 Received: from mx1.redhat.com ([209.132.183.28]:48238) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1ehIfY-0005Jd-IK; Thu, 01 Feb 2018 12:29:04 -0500 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 1E367C07991B; Thu, 1 Feb 2018 17:28:58 +0000 (UTC) Received: from amd-seattle-09.khw.lab.eng.bos.redhat.com (amd-seattle-09.khw.lab.eng.bos.redhat.com [10.16.184.112]) by smtp.corp.redhat.com (Postfix) with ESMTP id 3B55A7E09D; Thu, 1 Feb 2018 17:28:21 +0000 (UTC) From: Wei Huang To: qemu-devel@nongnu.org Date: Thu, 1 Feb 2018 12:28:08 -0500 Message-Id: <1517506091-10396-1-git-send-email-wei@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.31]); Thu, 01 Feb 2018 17:28:58 +0000 (UTC) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PATCH 1/4] hw/arm/virt: Set default machine and CPU types for mach-virt 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: wei@redhat.com, peter.maydell@linaro.org, drjones@redhat.com, qemu-arm@nongnu.org Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" X-Virus-Scanned: ClamAV using ClamSMTP Unlike most other QEMU architectures, the default machine type for mach-virt is not set. This causes problems in situations where the default machine types are not provided (e.g. qtest_start() function in many QEMU tests). This patch designates the latest mach-virt machine type (alias of "virt") as the default machine type. It also changes the default CPU depending on the target. Signed-off-by: Wei Huang --- hw/arm/virt.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/hw/arm/virt.c b/hw/arm/virt.c index b334c82..f6b1408 100644 --- a/hw/arm/virt.c +++ b/hw/arm/virt.c @@ -68,6 +68,7 @@ mc->desc = "QEMU " # major "." # minor " ARM Virtual Machine"; \ if (latest) { \ mc->alias = "virt"; \ + mc->is_default = 1; \ } \ } \ static const TypeInfo machvirt_##major##_##minor##_info = { \ @@ -1603,7 +1604,12 @@ static void virt_machine_class_init(ObjectClass *oc, void *data) mc->minimum_page_bits = 12; mc->possible_cpu_arch_ids = virt_possible_cpu_arch_ids; mc->cpu_index_to_instance_props = virt_cpu_index_to_props; +#ifdef TARGET_AARCH64 + mc->default_cpu_type = ARM_CPU_TYPE_NAME("cortex-a57"); +#else mc->default_cpu_type = ARM_CPU_TYPE_NAME("cortex-a15"); +#endif + mc->get_default_cpu_node_id = virt_get_default_cpu_node_id; }