From patchwork Wed Apr 23 13:42:37 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Gabriel L. Somlo" X-Patchwork-Id: 341873 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org 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 ozlabs.org (Postfix) with ESMTPS id AE35F140148 for ; Wed, 23 Apr 2014 23:48:13 +1000 (EST) Received: from localhost ([::1]:32932 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WcxX1-0002bp-6L for incoming@patchwork.ozlabs.org; Wed, 23 Apr 2014 09:48:11 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:59697) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WcxS5-0003rL-7b for qemu-devel@nongnu.org; Wed, 23 Apr 2014 09:43:13 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WcxRv-0004zP-Q0 for qemu-devel@nongnu.org; Wed, 23 Apr 2014 09:43:05 -0400 Received: from mail-qg0-x22c.google.com ([2607:f8b0:400d:c04::22c]:56657) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WcxRv-0004zJ-Kx for qemu-devel@nongnu.org; Wed, 23 Apr 2014 09:42:55 -0400 Received: by mail-qg0-f44.google.com with SMTP id q108so915886qgd.17 for ; Wed, 23 Apr 2014 06:42:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=tyR/3sSIVoXMNCel5D++L7Nyzr80F1f75eBCd9KE0SI=; b=dv/TRGffDXf+jR5aIDCgNalG+0fK7hejDe/wopfOdel78UXsi57n8Ots7cPZD9Zd4P NM/jv9zA887zF+3DP0/d6LHUgVJbUyR0h6gzF09iou4ET4U66tshcWMQSqTXcfxKyEVO c8VYJ1krkmGFb1lZDSQA/WDpaRsZZu//dCYY3D1SwXQDFK42vBY4WzWByE37rVIZLQUk 3fnTGO2vAzGkAX2mxFu7Pt6pJBBhRzsiNNcpAQLPCV+JQbjAyv+9nFGav/6p3ogTKt4B Hq7yghroDskJtTLdDmFvVbuLB0wOBSFmPtdB0vC6yXGyCVw9o/SAHyG3KkkfIyJ058sb YiDA== X-Received: by 10.229.66.133 with SMTP id n5mr57294312qci.0.1398260575164; Wed, 23 Apr 2014 06:42:55 -0700 (PDT) Received: from ERROL.ini.cmu.edu (ERROL.INI.CMU.EDU. [128.2.16.43]) by mx.google.com with ESMTPSA id 104sm1157221qgq.1.2014.04.23.06.42.54 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 23 Apr 2014 06:42:54 -0700 (PDT) X-Google-Original-From: "Gabriel L. Somlo" From: "Gabriel L. Somlo" To: qemu-devel@nongnu.org Date: Wed, 23 Apr 2014 09:42:37 -0400 Message-Id: <1398260562-7933-3-git-send-email-somlo@cmu.edu> X-Mailer: git-send-email 1.9.0 In-Reply-To: <1398260562-7933-1-git-send-email-somlo@cmu.edu> References: <1398260562-7933-1-git-send-email-somlo@cmu.edu> X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-Received-From: 2607:f8b0:400d:c04::22c Cc: seabios@seabios.org, agraf@suse.de, armbru@redhat.com, kevin@koconnor.net, kraxel@redhat.com, lersek@redhat.com Subject: [Qemu-devel] [QEMU v8 PATCH 2/7] PC: Add machine version 2.1 for piix and q35 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+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Add v2.1 machine types and (empty) compat functions for v2.0, to both piix and q35. For now, the new machines will behave identically to their 2.0 counterparts. Signed-off-by: Gabriel Somlo --- hw/i386/pc_piix.c | 27 ++++++++++++++++++++++++--- hw/i386/pc_q35.c | 25 +++++++++++++++++++++++-- 2 files changed, 47 insertions(+), 5 deletions(-) diff --git a/hw/i386/pc_piix.c b/hw/i386/pc_piix.c index 7930a26..f13d0ac 100644 --- a/hw/i386/pc_piix.c +++ b/hw/i386/pc_piix.c @@ -262,8 +262,13 @@ static void pc_init_pci(QEMUMachineInitArgs *args) pc_init1(args, 1, 1); } +static void pc_compat_2_0(QEMUMachineInitArgs *args) +{ +} + static void pc_compat_1_7(QEMUMachineInitArgs *args) { + pc_compat_2_0(args); smbios_type1_defaults = false; gigabyte_align = false; option_rom_has_mr = true; @@ -303,6 +308,12 @@ static void pc_compat_1_2(QEMUMachineInitArgs *args) x86_cpu_compat_disable_kvm_features(FEAT_KVM, KVM_FEATURE_PV_EOI); } +static void pc_init_pci_2_0(QEMUMachineInitArgs *args) +{ + pc_compat_2_0(args); + pc_init_pci(args); +} + static void pc_init_pci_1_7(QEMUMachineInitArgs *args) { pc_compat_1_7(args); @@ -387,14 +398,23 @@ static void pc_xen_hvm_init(QEMUMachineInitArgs *args) PC_I440FX_MACHINE_OPTIONS, \ .default_machine_opts = "firmware=bios-256k.bin" -static QEMUMachine pc_i440fx_machine_v2_0 = { - PC_I440FX_2_0_MACHINE_OPTIONS, - .name = "pc-i440fx-2.0", +#define PC_I440FX_2_1_MACHINE_OPTIONS \ + PC_I440FX_2_0_MACHINE_OPTIONS + +static QEMUMachine pc_i440fx_machine_v2_1 = { + PC_I440FX_2_1_MACHINE_OPTIONS, + .name = "pc-i440fx-2.1", .alias = "pc", .init = pc_init_pci, .is_default = 1, }; +static QEMUMachine pc_i440fx_machine_v2_0 = { + PC_I440FX_2_0_MACHINE_OPTIONS, + .name = "pc-i440fx-2.0", + .init = pc_init_pci_2_0, +}; + #define PC_I440FX_1_7_MACHINE_OPTIONS PC_I440FX_MACHINE_OPTIONS static QEMUMachine pc_i440fx_machine_v1_7 = { @@ -817,6 +837,7 @@ static QEMUMachine xenfv_machine = { static void pc_machine_init(void) { + qemu_register_machine(&pc_i440fx_machine_v2_1); qemu_register_machine(&pc_i440fx_machine_v2_0); qemu_register_machine(&pc_i440fx_machine_v1_7); qemu_register_machine(&pc_i440fx_machine_v1_6); diff --git a/hw/i386/pc_q35.c b/hw/i386/pc_q35.c index c844dc2..1622700 100644 --- a/hw/i386/pc_q35.c +++ b/hw/i386/pc_q35.c @@ -240,8 +240,13 @@ static void pc_q35_init(QEMUMachineInitArgs *args) } } +static void pc_compat_2_0(QEMUMachineInitArgs *args) +{ +} + static void pc_compat_1_7(QEMUMachineInitArgs *args) { + pc_compat_2_0(args); smbios_type1_defaults = false; gigabyte_align = false; option_rom_has_mr = true; @@ -268,6 +273,12 @@ static void pc_compat_1_4(QEMUMachineInitArgs *args) x86_cpu_compat_set_features("Westmere", FEAT_1_ECX, 0, CPUID_EXT_PCLMULQDQ); } +static void pc_q35_init_2_0(QEMUMachineInitArgs *args) +{ + pc_compat_2_0(args); + pc_q35_init(args); +} + static void pc_q35_init_1_7(QEMUMachineInitArgs *args) { pc_compat_1_7(args); @@ -301,11 +312,20 @@ static void pc_q35_init_1_4(QEMUMachineInitArgs *args) PC_Q35_MACHINE_OPTIONS, \ .default_machine_opts = "firmware=bios-256k.bin" +#define PC_Q35_2_1_MACHINE_OPTIONS \ + PC_Q35_2_0_MACHINE_OPTIONS + +static QEMUMachine pc_q35_machine_v2_1 = { + PC_Q35_2_1_MACHINE_OPTIONS, + .name = "pc-q35-2.1", + .alias = "q35", + .init = pc_q35_init, +}; + static QEMUMachine pc_q35_machine_v2_0 = { PC_Q35_2_0_MACHINE_OPTIONS, .name = "pc-q35-2.0", - .alias = "q35", - .init = pc_q35_init, + .init = pc_q35_init_2_0, }; #define PC_Q35_1_7_MACHINE_OPTIONS PC_Q35_MACHINE_OPTIONS @@ -358,6 +378,7 @@ static QEMUMachine pc_q35_machine_v1_4 = { static void pc_q35_machine_init(void) { + qemu_register_machine(&pc_q35_machine_v2_1); qemu_register_machine(&pc_q35_machine_v2_0); qemu_register_machine(&pc_q35_machine_v1_7); qemu_register_machine(&pc_q35_machine_v1_6);