qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Eduardo Habkost <ehabkost@redhat.com>
To: Peter Maydell <peter.maydell@linaro.org>, qemu-devel@nongnu.org
Cc: Marcel Apfelbaum <marcel.apfelbaum@gmail.com>,
	Alex Williamson <alex.williamson@redhat.com>,
	"Michael S . Tsirkin" <mst@redhat.com>,
	Paolo Bonzini <pbonzini@redhat.com>,
	Richard Henderson <rth@twiddle.net>
Subject: [Qemu-devel] [PULL 13/24] q35/440fx/arm/spapr: Add QEMU 4.0 machine type
Date: Tue, 11 Dec 2018 16:01:18 -0200	[thread overview]
Message-ID: <20181211180129.7661-14-ehabkost@redhat.com> (raw)
In-Reply-To: <20181211180129.7661-1-ehabkost@redhat.com>

From: Alex Williamson <alex.williamson@redhat.com>

Including all machine types that might have a pcie-root-port.

Cc: Peter Maydell <peter.maydell@linaro.org>
Cc: Michael S. Tsirkin <mst@redhat.com>
Cc: Marcel Apfelbaum <marcel.apfelbaum@gmail.com>
Cc: Paolo Bonzini <pbonzini@redhat.com>
Cc: Richard Henderson <rth@twiddle.net>
Cc: Eduardo Habkost <ehabkost@redhat.com>
Acked-by: David Gibson <david@gibson.dropbear.id.au>
Signed-off-by: Alex Williamson <alex.williamson@redhat.com>
Message-Id: <154394083644.28192.8501647946108201466.stgit@gimli.home>
Reviewed-by: Eric Auger <eric.auger@redhat.com>
[ehabkost: fixed accidental recursion at spapr_machine_3_1_class_options()]
Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
---
 include/hw/compat.h  |  3 +++
 include/hw/i386/pc.h |  3 +++
 hw/arm/virt.c        | 19 +++++++++++++++++--
 hw/i386/pc_piix.c    | 15 ++++++++++++---
 hw/i386/pc_q35.c     | 13 +++++++++++--
 hw/ppc/spapr.c       | 25 ++++++++++++++++++++++---
 6 files changed, 68 insertions(+), 10 deletions(-)

diff --git a/include/hw/compat.h b/include/hw/compat.h
index 6f4d5fc647..70958328fe 100644
--- a/include/hw/compat.h
+++ b/include/hw/compat.h
@@ -1,6 +1,9 @@
 #ifndef HW_COMPAT_H
 #define HW_COMPAT_H
 
+#define HW_COMPAT_3_1 \
+    /* empty */
+
 #define HW_COMPAT_3_0 \
     /* empty */
 
diff --git a/include/hw/i386/pc.h b/include/hw/i386/pc.h
index 7bb52b4762..9d29c4b1df 100644
--- a/include/hw/i386/pc.h
+++ b/include/hw/i386/pc.h
@@ -294,6 +294,9 @@ int e820_add_entry(uint64_t, uint64_t, uint32_t);
 int e820_get_num_entries(void);
 bool e820_get_entry(int, uint32_t, uint64_t *, uint64_t *);
 
+#define PC_COMPAT_3_1 \
+    HW_COMPAT_3_1 \
+
 #define PC_COMPAT_3_0 \
     HW_COMPAT_3_0 \
     {\
diff --git a/hw/arm/virt.c b/hw/arm/virt.c
index f69e7eb399..beaf6bc439 100644
--- a/hw/arm/virt.c
+++ b/hw/arm/virt.c
@@ -1797,7 +1797,7 @@ static void machvirt_machine_init(void)
 }
 type_init(machvirt_machine_init);
 
-static void virt_3_1_instance_init(Object *obj)
+static void virt_4_0_instance_init(Object *obj)
 {
     VirtMachineState *vms = VIRT_MACHINE(obj);
     VirtMachineClass *vmc = VIRT_MACHINE_GET_CLASS(vms);
@@ -1867,10 +1867,25 @@ static void virt_3_1_instance_init(Object *obj)
     vms->irqmap = a15irqmap;
 }
 
+static void virt_machine_4_0_options(MachineClass *mc)
+{
+}
+DEFINE_VIRT_MACHINE_AS_LATEST(4, 0)
+
+#define VIRT_COMPAT_3_1 \
+    HW_COMPAT_3_1
+
+static void virt_3_1_instance_init(Object *obj)
+{
+    virt_4_0_instance_init(obj);
+}
+
 static void virt_machine_3_1_options(MachineClass *mc)
 {
+    virt_machine_4_0_options(mc);
+    SET_MACHINE_COMPAT(mc, VIRT_COMPAT_3_1);
 }
-DEFINE_VIRT_MACHINE_AS_LATEST(3, 1)
+DEFINE_VIRT_MACHINE(3, 1)
 
 #define VIRT_COMPAT_3_0 \
     HW_COMPAT_3_0
diff --git a/hw/i386/pc_piix.c b/hw/i386/pc_piix.c
index 2d996162f1..d9b04c8427 100644
--- a/hw/i386/pc_piix.c
+++ b/hw/i386/pc_piix.c
@@ -429,21 +429,30 @@ static void pc_i440fx_machine_options(MachineClass *m)
     machine_class_allow_dynamic_sysbus_dev(m, TYPE_RAMFB_DEVICE);
 }
 
-static void pc_i440fx_3_1_machine_options(MachineClass *m)
+static void pc_i440fx_4_0_machine_options(MachineClass *m)
 {
     pc_i440fx_machine_options(m);
     m->alias = "pc";
     m->is_default = 1;
 }
 
+DEFINE_I440FX_MACHINE(v4_0, "pc-i440fx-4.0", NULL,
+                      pc_i440fx_4_0_machine_options);
+
+static void pc_i440fx_3_1_machine_options(MachineClass *m)
+{
+    pc_i440fx_4_0_machine_options(m);
+    m->is_default = 0;
+    m->alias = NULL;
+    SET_MACHINE_COMPAT(m, PC_COMPAT_3_1);
+}
+
 DEFINE_I440FX_MACHINE(v3_1, "pc-i440fx-3.1", NULL,
                       pc_i440fx_3_1_machine_options);
 
 static void pc_i440fx_3_0_machine_options(MachineClass *m)
 {
     pc_i440fx_3_1_machine_options(m);
-    m->is_default = 0;
-    m->alias = NULL;
     SET_MACHINE_COMPAT(m, PC_COMPAT_3_0);
 }
 
diff --git a/hw/i386/pc_q35.c b/hw/i386/pc_q35.c
index 6e3d81f5be..58459bdab5 100644
--- a/hw/i386/pc_q35.c
+++ b/hw/i386/pc_q35.c
@@ -311,19 +311,28 @@ static void pc_q35_machine_options(MachineClass *m)
     m->max_cpus = 288;
 }
 
-static void pc_q35_3_1_machine_options(MachineClass *m)
+static void pc_q35_4_0_machine_options(MachineClass *m)
 {
     pc_q35_machine_options(m);
     m->alias = "q35";
 }
 
+DEFINE_Q35_MACHINE(v4_0, "pc-q35-4.0", NULL,
+                   pc_q35_4_0_machine_options);
+
+static void pc_q35_3_1_machine_options(MachineClass *m)
+{
+    pc_q35_4_0_machine_options(m);
+    m->alias = NULL;
+    SET_MACHINE_COMPAT(m, PC_COMPAT_3_1);
+}
+
 DEFINE_Q35_MACHINE(v3_1, "pc-q35-3.1", NULL,
                    pc_q35_3_1_machine_options);
 
 static void pc_q35_3_0_machine_options(MachineClass *m)
 {
     pc_q35_3_1_machine_options(m);
-    m->alias = NULL;
     SET_MACHINE_COMPAT(m, PC_COMPAT_3_0);
 }
 
diff --git a/hw/ppc/spapr.c b/hw/ppc/spapr.c
index 7afd1a175b..def3e502d8 100644
--- a/hw/ppc/spapr.c
+++ b/hw/ppc/spapr.c
@@ -3956,19 +3956,38 @@ static const TypeInfo spapr_machine_info = {
     }                                                                \
     type_init(spapr_machine_register_##suffix)
 
- /*
+/*
+ * pseries-4.0
+ */
+static void spapr_machine_4_0_instance_options(MachineState *machine)
+{
+}
+
+static void spapr_machine_4_0_class_options(MachineClass *mc)
+{
+    /* Defaults for the latest behaviour inherited from the base class */
+}
+
+DEFINE_SPAPR_MACHINE(4_0, "4.0", true);
+
+/*
  * pseries-3.1
  */
+#define SPAPR_COMPAT_3_1                                              \
+    HW_COMPAT_3_1
+
 static void spapr_machine_3_1_instance_options(MachineState *machine)
 {
+    spapr_machine_4_0_instance_options(machine);
 }
 
 static void spapr_machine_3_1_class_options(MachineClass *mc)
 {
-    /* Defaults for the latest behaviour inherited from the base class */
+    spapr_machine_4_0_class_options(mc);
+    SET_MACHINE_COMPAT(mc, SPAPR_COMPAT_3_1);
 }
 
-DEFINE_SPAPR_MACHINE(3_1, "3.1", true);
+DEFINE_SPAPR_MACHINE(3_1, "3.1", false);
 
 /*
  * pseries-3.0
-- 
2.18.0.rc1.1.g3f1ff2140

  parent reply	other threads:[~2018-12-11 18:02 UTC|newest]

Thread overview: 29+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-12-11 18:01 [Qemu-devel] [PULL 00/24] Machine queue post-3.1.0 (including 4.0 machine-types) Eduardo Habkost
2018-12-11 18:01 ` [Qemu-devel] [PULL 01/24] hostmem-file: remove object id from pmem error message Eduardo Habkost
2018-12-11 18:01 ` [Qemu-devel] [PULL 02/24] hw/timer/sun4v-rtc: Fix tracing at sun4v_rtc_write() Eduardo Habkost
2018-12-11 18:01 ` [Qemu-devel] [PULL 03/24] docs: Document vCPU hotplug procedure Eduardo Habkost
2018-12-11 18:01 ` [Qemu-devel] [PULL 04/24] Deprecate QMP `cpu-add` Eduardo Habkost
2018-12-11 18:01 ` [Qemu-devel] [PULL 05/24] Deprecate HMP `cpu-add` Eduardo Habkost
2018-12-11 18:01 ` [Qemu-devel] [PULL 06/24] range: pass const pointer where possible Eduardo Habkost
2018-12-11 18:01 ` [Qemu-devel] [PULL 07/24] memory-device: use QEMU_IS_ALIGNED Eduardo Habkost
2018-12-11 18:01 ` [Qemu-devel] [PULL 08/24] memory-device: avoid overflows on very huge devices Eduardo Habkost
2018-12-11 18:01 ` [Qemu-devel] [PULL 09/24] move ObjectClass to typedefs.h Eduardo Habkost
2018-12-11 18:01 ` [Qemu-devel] [PULL 10/24] i386: Rename bools in PCMachineState to end in _enabled Eduardo Habkost
2018-12-11 18:01 ` [Qemu-devel] [PULL 11/24] numa: Match struct to typedef name Eduardo Habkost
2018-12-11 18:01 ` [Qemu-devel] [PULL 12/24] hostmem: Validate host-nodes before setting bitmap Eduardo Habkost
2018-12-11 18:01 ` Eduardo Habkost [this message]
2018-12-12 12:51   ` [Qemu-devel] [PULL 13/24] q35/440fx/arm/spapr: Add QEMU 4.0 machine type Marc-André Lureau
2018-12-12 12:52     ` Marc-André Lureau
2018-12-11 18:01 ` [Qemu-devel] [PULL 14/24] virt: Eliminate separate instance_init functions Eduardo Habkost
2018-12-11 18:01 ` [Qemu-devel] [PULL 15/24] spapr: Use default_machine_opts to set use_hotplug_event_source Eduardo Habkost
2018-12-11 18:01 ` [Qemu-devel] [PULL 16/24] spapr: Use default_machine_opts to set suppress_vmdesc Eduardo Habkost
2018-12-11 18:01 ` [Qemu-devel] [PULL 17/24] spapr: Delete instance_options functions Eduardo Habkost
2018-12-11 18:01 ` [Qemu-devel] [PULL 18/24] pc: Use default_machine_opts to set suppress_vmdesc Eduardo Habkost
2018-12-11 18:01 ` [Qemu-devel] [PULL 19/24] tests: qdev_prop_check_globals() doesn't return "all_used" Eduardo Habkost
2018-12-11 18:01 ` [Qemu-devel] [PULL 20/24] qom: make interface types abstract Eduardo Habkost
2018-12-11 18:01 ` [Qemu-devel] [PULL 21/24] qom: make user_creatable_complete() specific to UserCreatable Eduardo Habkost
2018-12-11 18:01 ` [Qemu-devel] [PULL 22/24] accel: register global_props like machine globals Eduardo Habkost
2018-12-11 18:01 ` [Qemu-devel] [PULL 23/24] qdev: move qdev_prop_register_global_list() to tests Eduardo Habkost
2018-12-11 18:01 ` [Qemu-devel] [PULL 24/24] qom: remove unimplemented class_finalize Eduardo Habkost
2018-12-11 22:26 ` [Qemu-devel] [PULL 00/24] Machine queue post-3.1.0 (including 4.0 machine-types) Peter Maydell
2018-12-12  0:20 ` no-reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20181211180129.7661-14-ehabkost@redhat.com \
    --to=ehabkost@redhat.com \
    --cc=alex.williamson@redhat.com \
    --cc=marcel.apfelbaum@gmail.com \
    --cc=mst@redhat.com \
    --cc=pbonzini@redhat.com \
    --cc=peter.maydell@linaro.org \
    --cc=qemu-devel@nongnu.org \
    --cc=rth@twiddle.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).