aboutsummaryrefslogtreecommitdiff
path: root/hw/ppc/spapr.c
diff options
context:
space:
mode:
Diffstat (limited to 'hw/ppc/spapr.c')
-rw-r--r--hw/ppc/spapr.c201
1 files changed, 107 insertions, 94 deletions
diff --git a/hw/ppc/spapr.c b/hw/ppc/spapr.c
index 19a07c5..f724a8d 100644
--- a/hw/ppc/spapr.c
+++ b/hw/ppc/spapr.c
@@ -4021,13 +4021,14 @@ DEFINE_SPAPR_MACHINE(4_0, "4.0", true);
/*
* pseries-3.1
*/
-#define SPAPR_COMPAT_3_1 \
+static GlobalProperty spapr_compat_3_1[] = {
HW_COMPAT_3_1
+};
static void spapr_machine_3_1_class_options(MachineClass *mc)
{
spapr_machine_4_0_class_options(mc);
- SET_MACHINE_COMPAT(mc, SPAPR_COMPAT_3_1);
+ SET_MACHINE_COMPAT(mc, spapr_compat_3_1);
mc->default_cpu_type = POWERPC_CPU_TYPE_NAME("power8_v2.0");
}
@@ -4036,15 +4037,16 @@ DEFINE_SPAPR_MACHINE(3_1, "3.1", false);
/*
* pseries-3.0
*/
-#define SPAPR_COMPAT_3_0 \
+static GlobalProperty spapr_compat_3_0[] = {
HW_COMPAT_3_0
+};
static void spapr_machine_3_0_class_options(MachineClass *mc)
{
sPAPRMachineClass *smc = SPAPR_MACHINE_CLASS(mc);
spapr_machine_3_1_class_options(mc);
- SET_MACHINE_COMPAT(mc, SPAPR_COMPAT_3_0);
+ SET_MACHINE_COMPAT(mc, spapr_compat_3_0);
smc->legacy_irq_allocation = true;
smc->irq = &spapr_irq_xics_legacy;
@@ -4055,25 +4057,26 @@ DEFINE_SPAPR_MACHINE(3_0, "3.0", false);
/*
* pseries-2.12
*/
-#define SPAPR_COMPAT_2_12 \
- HW_COMPAT_2_12 \
- { \
- .driver = TYPE_POWERPC_CPU, \
- .property = "pre-3.0-migration", \
- .value = "on", \
- }, \
- { \
- .driver = TYPE_SPAPR_CPU_CORE, \
- .property = "pre-3.0-migration", \
- .value = "on", \
+static GlobalProperty spapr_compat_2_12[] = {
+ HW_COMPAT_2_12
+ {
+ .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_2_12_class_options(MachineClass *mc)
{
sPAPRMachineClass *smc = SPAPR_MACHINE_CLASS(mc);
spapr_machine_3_0_class_options(mc);
- SET_MACHINE_COMPAT(mc, SPAPR_COMPAT_2_12);
+ SET_MACHINE_COMPAT(mc, spapr_compat_2_12);
/* 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
@@ -4100,8 +4103,9 @@ DEFINE_SPAPR_MACHINE(2_12_sxxm, "2.12-sxxm", false);
/*
* pseries-2.11
*/
-#define SPAPR_COMPAT_2_11 \
+static GlobalProperty spapr_compat_2_11[] = {
HW_COMPAT_2_11
+};
static void spapr_machine_2_11_class_options(MachineClass *mc)
{
@@ -4109,7 +4113,7 @@ static void spapr_machine_2_11_class_options(MachineClass *mc)
spapr_machine_2_12_class_options(mc);
smc->default_caps.caps[SPAPR_CAP_HTM] = SPAPR_CAP_ON;
- SET_MACHINE_COMPAT(mc, SPAPR_COMPAT_2_11);
+ SET_MACHINE_COMPAT(mc, spapr_compat_2_11);
}
DEFINE_SPAPR_MACHINE(2_11, "2.11", false);
@@ -4117,13 +4121,14 @@ DEFINE_SPAPR_MACHINE(2_11, "2.11", false);
/*
* pseries-2.10
*/
-#define SPAPR_COMPAT_2_10 \
+static GlobalProperty spapr_compat_2_10[] = {
HW_COMPAT_2_10
+};
static void spapr_machine_2_10_class_options(MachineClass *mc)
{
spapr_machine_2_11_class_options(mc);
- SET_MACHINE_COMPAT(mc, SPAPR_COMPAT_2_10);
+ SET_MACHINE_COMPAT(mc, spapr_compat_2_10);
}
DEFINE_SPAPR_MACHINE(2_10, "2.10", false);
@@ -4131,20 +4136,21 @@ DEFINE_SPAPR_MACHINE(2_10, "2.10", false);
/*
* pseries-2.9
*/
-#define SPAPR_COMPAT_2_9 \
- HW_COMPAT_2_9 \
- { \
- .driver = TYPE_POWERPC_CPU, \
- .property = "pre-2.10-migration", \
- .value = "on", \
- }, \
+static GlobalProperty spapr_compat_2_9[] = {
+ HW_COMPAT_2_9
+ {
+ .driver = TYPE_POWERPC_CPU,
+ .property = "pre-2.10-migration",
+ .value = "on",
+ },
+};
static void spapr_machine_2_9_class_options(MachineClass *mc)
{
sPAPRMachineClass *smc = SPAPR_MACHINE_CLASS(mc);
spapr_machine_2_10_class_options(mc);
- SET_MACHINE_COMPAT(mc, SPAPR_COMPAT_2_9);
+ SET_MACHINE_COMPAT(mc, spapr_compat_2_9);
mc->numa_auto_assign_ram = numa_legacy_auto_assign_ram;
smc->pre_2_10_has_unused_icps = true;
smc->resize_hpt_default = SPAPR_RESIZE_HPT_DISABLED;
@@ -4155,18 +4161,19 @@ DEFINE_SPAPR_MACHINE(2_9, "2.9", false);
/*
* pseries-2.8
*/
-#define SPAPR_COMPAT_2_8 \
- HW_COMPAT_2_8 \
- { \
- .driver = TYPE_SPAPR_PCI_HOST_BRIDGE, \
- .property = "pcie-extended-configuration-space", \
- .value = "off", \
+static GlobalProperty spapr_compat_2_8[] = {
+ HW_COMPAT_2_8
+ {
+ .driver = TYPE_SPAPR_PCI_HOST_BRIDGE,
+ .property = "pcie-extended-configuration-space",
+ .value = "off",
},
+};
static void spapr_machine_2_8_class_options(MachineClass *mc)
{
spapr_machine_2_9_class_options(mc);
- SET_MACHINE_COMPAT(mc, SPAPR_COMPAT_2_8);
+ SET_MACHINE_COMPAT(mc, spapr_compat_2_8);
mc->numa_mem_align_shift = 23;
}
@@ -4175,28 +4182,29 @@ DEFINE_SPAPR_MACHINE(2_8, "2.8", false);
/*
* pseries-2.7
*/
-#define SPAPR_COMPAT_2_7 \
- HW_COMPAT_2_7 \
- { \
- .driver = TYPE_SPAPR_PCI_HOST_BRIDGE, \
- .property = "mem_win_size", \
- .value = stringify(SPAPR_PCI_2_7_MMIO_WIN_SIZE),\
- }, \
- { \
- .driver = TYPE_SPAPR_PCI_HOST_BRIDGE, \
- .property = "mem64_win_size", \
- .value = "0", \
- }, \
- { \
- .driver = TYPE_POWERPC_CPU, \
- .property = "pre-2.8-migration", \
- .value = "on", \
- }, \
- { \
- .driver = TYPE_SPAPR_PCI_HOST_BRIDGE, \
- .property = "pre-2.8-migration", \
- .value = "on", \
+static GlobalProperty spapr_compat_2_7[] = {
+ HW_COMPAT_2_7
+ {
+ .driver = TYPE_SPAPR_PCI_HOST_BRIDGE,
+ .property = "mem_win_size",
+ .value = stringify(SPAPR_PCI_2_7_MMIO_WIN_SIZE),
+ },
+ {
+ .driver = TYPE_SPAPR_PCI_HOST_BRIDGE,
+ .property = "mem64_win_size",
+ .value = "0",
+ },
+ {
+ .driver = TYPE_POWERPC_CPU,
+ .property = "pre-2.8-migration",
+ .value = "on",
},
+ {
+ .driver = TYPE_SPAPR_PCI_HOST_BRIDGE,
+ .property = "pre-2.8-migration",
+ .value = "on",
+ },
+};
static void phb_placement_2_7(sPAPRMachineState *spapr, uint32_t index,
uint64_t *buid, hwaddr *pio,
@@ -4254,7 +4262,7 @@ static void spapr_machine_2_7_class_options(MachineClass *mc)
spapr_machine_2_8_class_options(mc);
mc->default_cpu_type = POWERPC_CPU_TYPE_NAME("power7_v2.3");
mc->default_machine_opts = "modern-hotplug-events=off";
- SET_MACHINE_COMPAT(mc, SPAPR_COMPAT_2_7);
+ SET_MACHINE_COMPAT(mc, spapr_compat_2_7);
smc->phb_placement = phb_placement_2_7;
}
@@ -4263,19 +4271,20 @@ DEFINE_SPAPR_MACHINE(2_7, "2.7", false);
/*
* pseries-2.6
*/
-#define SPAPR_COMPAT_2_6 \
- HW_COMPAT_2_6 \
- { \
- .driver = TYPE_SPAPR_PCI_HOST_BRIDGE,\
- .property = "ddw",\
- .value = stringify(off),\
+static GlobalProperty spapr_compat_2_6[] = {
+ HW_COMPAT_2_6
+ {
+ .driver = TYPE_SPAPR_PCI_HOST_BRIDGE,
+ .property = "ddw",
+ .value = stringify(off),
},
+};
static void spapr_machine_2_6_class_options(MachineClass *mc)
{
spapr_machine_2_7_class_options(mc);
mc->has_hotpluggable_cpus = false;
- SET_MACHINE_COMPAT(mc, SPAPR_COMPAT_2_6);
+ SET_MACHINE_COMPAT(mc, spapr_compat_2_6);
}
DEFINE_SPAPR_MACHINE(2_6, "2.6", false);
@@ -4283,13 +4292,14 @@ DEFINE_SPAPR_MACHINE(2_6, "2.6", false);
/*
* pseries-2.5
*/
-#define SPAPR_COMPAT_2_5 \
- HW_COMPAT_2_5 \
- { \
- .driver = "spapr-vlan", \
- .property = "use-rx-buffer-pools", \
- .value = "off", \
+static GlobalProperty spapr_compat_2_5[] = {
+ HW_COMPAT_2_5
+ {
+ .driver = "spapr-vlan",
+ .property = "use-rx-buffer-pools",
+ .value = "off",
},
+};
static void spapr_machine_2_5_class_options(MachineClass *mc)
{
@@ -4297,7 +4307,7 @@ static void spapr_machine_2_5_class_options(MachineClass *mc)
spapr_machine_2_6_class_options(mc);
smc->use_ohci_by_default = true;
- SET_MACHINE_COMPAT(mc, SPAPR_COMPAT_2_5);
+ SET_MACHINE_COMPAT(mc, spapr_compat_2_5);
}
DEFINE_SPAPR_MACHINE(2_5, "2.5", false);
@@ -4305,8 +4315,9 @@ DEFINE_SPAPR_MACHINE(2_5, "2.5", false);
/*
* pseries-2.4
*/
-#define SPAPR_COMPAT_2_4 \
- HW_COMPAT_2_4
+static GlobalProperty spapr_compat_2_4[] = {
+ HW_COMPAT_2_4
+};
static void spapr_machine_2_4_class_options(MachineClass *mc)
{
@@ -4314,7 +4325,7 @@ static void spapr_machine_2_4_class_options(MachineClass *mc)
spapr_machine_2_5_class_options(mc);
smc->dr_lmb_enabled = false;
- SET_MACHINE_COMPAT(mc, SPAPR_COMPAT_2_4);
+ SET_MACHINE_COMPAT(mc, spapr_compat_2_4);
}
DEFINE_SPAPR_MACHINE(2_4, "2.4", false);
@@ -4322,37 +4333,38 @@ DEFINE_SPAPR_MACHINE(2_4, "2.4", false);
/*
* pseries-2.3
*/
-#define SPAPR_COMPAT_2_3 \
- HW_COMPAT_2_3 \
- {\
- .driver = "spapr-pci-host-bridge",\
- .property = "dynamic-reconfiguration",\
- .value = "off",\
- },
+static GlobalProperty spapr_compat_2_3[] = {
+ HW_COMPAT_2_3
+ {
+ .driver = "spapr-pci-host-bridge",
+ .property = "dynamic-reconfiguration",
+ .value = "off",
+ },
+};
static void spapr_machine_2_3_class_options(MachineClass *mc)
{
spapr_machine_2_4_class_options(mc);
- SET_MACHINE_COMPAT(mc, SPAPR_COMPAT_2_3);
+ SET_MACHINE_COMPAT(mc, spapr_compat_2_3);
}
DEFINE_SPAPR_MACHINE(2_3, "2.3", false);
/*
* pseries-2.2
*/
-
-#define SPAPR_COMPAT_2_2 \
- HW_COMPAT_2_2 \
- {\
- .driver = TYPE_SPAPR_PCI_HOST_BRIDGE,\
- .property = "mem_win_size",\
- .value = "0x20000000",\
- },
+static GlobalProperty spapr_compat_2_2[] = {
+ HW_COMPAT_2_2
+ {
+ .driver = TYPE_SPAPR_PCI_HOST_BRIDGE,
+ .property = "mem_win_size",
+ .value = "0x20000000",
+ },
+};
static void spapr_machine_2_2_class_options(MachineClass *mc)
{
spapr_machine_2_3_class_options(mc);
- SET_MACHINE_COMPAT(mc, SPAPR_COMPAT_2_2);
+ SET_MACHINE_COMPAT(mc, spapr_compat_2_2);
mc->default_machine_opts = "modern-hotplug-events=off,suppress-vmdesc=on";
}
DEFINE_SPAPR_MACHINE(2_2, "2.2", false);
@@ -4360,13 +4372,14 @@ DEFINE_SPAPR_MACHINE(2_2, "2.2", false);
/*
* pseries-2.1
*/
-#define SPAPR_COMPAT_2_1 \
- HW_COMPAT_2_1
+static GlobalProperty spapr_compat_2_1[] = {
+ HW_COMPAT_2_1
+};
static void spapr_machine_2_1_class_options(MachineClass *mc)
{
spapr_machine_2_2_class_options(mc);
- SET_MACHINE_COMPAT(mc, SPAPR_COMPAT_2_1);
+ SET_MACHINE_COMPAT(mc, spapr_compat_2_1);
}
DEFINE_SPAPR_MACHINE(2_1, "2.1", false);