qemu-kvm/kvm-redhat-define-pseries-r...

102 lines
3.6 KiB
Diff

From 6eddc4b5d380a5a21b17ca5424a10619ff42ad56 Mon Sep 17 00:00:00 2001
From: Laurent Vivier <lvivier@redhat.com>
Date: Thu, 20 Dec 2018 14:48:58 +0000
Subject: [PATCH] redhat: define pseries-rhel8.0.0 machine type
RH-Author: Laurent Vivier <lvivier@redhat.com>
Message-id: <20181220144858.2598-1-lvivier@redhat.com>
Patchwork-id: 83723
O-Subject: [RHEL8/rhel qemu-kvm PATCH] redhat: define pseries-rhel8.0.0 machine type
Bugzilla: 1656508
RH-Acked-by: Thomas Huth <thuth@redhat.com>
RH-Acked-by: David Gibson <dgibson@redhat.com>
RH-Acked-by: Serhii Popovych <spopovyc@redhat.com>
BZ: https://bugzilla.redhat.com/show_bug.cgi?id=1656508
BRANCH: rhel8/master-3.1.0
UPSTREAM: downstream only
BREW: https://brewweb.engineering.redhat.com/brew/taskinfo?taskID=19589897
BASED-ON: <20181214170211.14267-1-dgilbert@redhat.com>
[RHEL8 qemu-kvm PATCH v3 0/6] 8.0.0 x86 machine types
Signed-off-by: Laurent Vivier <lvivier@redhat.com>
Signed-off-by: Danilo C. L. de Paula <ddepaula@redhat.com>
---
hw/ppc/spapr.c | 49 +++++++++++++++++++++++++++++++++++++++++++++++--
1 file changed, 47 insertions(+), 2 deletions(-)
diff --git a/hw/ppc/spapr.c b/hw/ppc/spapr.c
index 76a4e83..91d38f9 100644
--- a/hw/ppc/spapr.c
+++ b/hw/ppc/spapr.c
@@ -4385,19 +4385,64 @@ DEFINE_SPAPR_MACHINE(2_1, "2.1", false);
#endif
/*
+ * pseries-rhel8.0.0
+ */
+
+static void spapr_machine_rhel800_instance_options(MachineState *machine)
+{
+}
+
+static void spapr_machine_rhel800_class_options(MachineClass *mc)
+{
+ /* Defaults for the latest behaviour inherited from the base class */
+}
+
+DEFINE_SPAPR_MACHINE(rhel800, "rhel8.0.0", true);
+
+/*
* pseries-rhel7.6.0
+ * like SPAPR_COMPAT_2_12 and SPAPR_COMPAT_3_0
+ * SPAPR_COMPAT_3_0 is empty
*/
+#define SPAPR_COMPAT_RHEL7_6 \
+ HW_COMPAT_RHEL7_6 \
+ { \
+ .driver = TYPE_POWERPC_CPU, \
+ .property = "pre-3.0-migration", \
+ .value = "on", \
+ }, \
+ { \
+ .driver = TYPE_SPAPR_CPU_CORE, \
+ .property = "pre-3.0-migration", \
+ .value = "on", \
+ },
static void spapr_machine_rhel760_instance_options(MachineState *machine)
{
+ spapr_machine_rhel800_instance_options(machine);
}
static void spapr_machine_rhel760_class_options(MachineClass *mc)
{
- /* Defaults for the latest behaviour inherited from the base class */
+ sPAPRMachineClass *smc = SPAPR_MACHINE_CLASS(mc);
+
+ spapr_machine_rhel800_class_options(mc);
+ SET_MACHINE_COMPAT(mc, SPAPR_COMPAT_RHEL7_6);
+
+ /* from spapr_machine_3_0_class_options() */
+ smc->legacy_irq_allocation = true;
+ smc->irq = &spapr_irq_xics_legacy;
+
+ /* from spapr_machine_2_12_class_options() */
+ /* We depend on kvm_enabled() to choose a default value for the
+ * hpt-max-page-size capability. Of course we can't do it here
+ * because this is too early and the HW accelerator isn't initialzed
+ * yet. Postpone this to machine init (see default_caps_with_cpu()).
+ */
+ smc->default_caps.caps[SPAPR_CAP_HPT_MAXPAGESIZE] = 0;
}
-DEFINE_SPAPR_MACHINE(rhel760, "rhel7.6.0", true);
+DEFINE_SPAPR_MACHINE(rhel760, "rhel7.6.0", false);
/*
* pseries-rhel7.6.0-sxxm
--
1.8.3.1