diff options
-rw-r--r-- | hw/arm/virt.c | 5 | ||||
-rw-r--r-- | hw/core/machine.c | 25 | ||||
-rw-r--r-- | hw/i386/pc.c | 34 | ||||
-rw-r--r-- | hw/i386/pc_piix.c | 7 | ||||
-rw-r--r-- | hw/i386/pc_q35.c | 7 | ||||
-rw-r--r-- | hw/ppc/spapr.c | 2 | ||||
-rw-r--r-- | hw/s390x/s390-virtio-ccw.c | 5 | ||||
-rw-r--r-- | include/hw/boards.h | 3 | ||||
-rw-r--r-- | include/hw/compat.h | 23 | ||||
-rw-r--r-- | include/hw/i386/pc.h | 34 |
10 files changed, 71 insertions, 74 deletions
diff --git a/hw/arm/virt.c b/hw/arm/virt.c index d4dee3e..0134d0d 100644 --- a/hw/arm/virt.c +++ b/hw/arm/virt.c @@ -1939,12 +1939,9 @@ DEFINE_VIRT_MACHINE(2, 8) static void virt_machine_2_7_options(MachineClass *mc) { VirtMachineClass *vmc = VIRT_MACHINE_CLASS(OBJECT_CLASS(mc)); - static GlobalProperty compat[] = { - HW_COMPAT_2_7 - }; virt_machine_2_8_options(mc); - compat_props_add(mc->compat_props, compat, G_N_ELEMENTS(compat)); + compat_props_add(mc->compat_props, hw_compat_2_7, hw_compat_2_7_len); /* ITS was introduced with 2.8 */ vmc->no_its = true; /* Stick with 1K pages for migration compatibility */ diff --git a/hw/core/machine.c b/hw/core/machine.c index efda98a..cc92b0c 100644 --- a/hw/core/machine.c +++ b/hw/core/machine.c @@ -168,6 +168,31 @@ GlobalProperty hw_compat_2_8[] = { }; const size_t hw_compat_2_8_len = G_N_ELEMENTS(hw_compat_2_8); +GlobalProperty hw_compat_2_7[] = { + { + .driver = "virtio-pci", + .property = "page-per-vq", + .value = "on", + },{ + .driver = "virtio-serial-device", + .property = "emergency-write", + .value = "off", + },{ + .driver = "ioapic", + .property = "version", + .value = "0x11", + },{ + .driver = "intel-iommu", + .property = "x-buggy-eim", + .value = "true", + },{ + .driver = "virtio-pci", + .property = "x-ignore-backend-features", + .value = "on", + }, +}; +const size_t hw_compat_2_7_len = G_N_ELEMENTS(hw_compat_2_7); + static char *machine_get_accel(Object *obj, Error **errp) { MachineState *ms = MACHINE(obj); diff --git a/hw/i386/pc.c b/hw/i386/pc.c index b094e5b..ed46f9c 100644 --- a/hw/i386/pc.c +++ b/hw/i386/pc.c @@ -224,6 +224,40 @@ GlobalProperty pc_compat_2_8[] = { }; const size_t pc_compat_2_8_len = G_N_ELEMENTS(pc_compat_2_8); +GlobalProperty pc_compat_2_7[] = { + { + .driver = TYPE_X86_CPU, + .property = "l3-cache", + .value = "off", + }, + { + .driver = TYPE_X86_CPU, + .property = "full-cpuid-auto-level", + .value = "off", + }, + { + .driver = "Opteron_G3" "-" TYPE_X86_CPU, + .property = "family", + .value = "15", + }, + { + .driver = "Opteron_G3" "-" TYPE_X86_CPU, + .property = "model", + .value = "6", + }, + { + .driver = "Opteron_G3" "-" TYPE_X86_CPU, + .property = "stepping", + .value = "1", + }, + { + .driver = "isa-pcspk", + .property = "migrate", + .value = "off", + }, +}; +const size_t pc_compat_2_7_len = G_N_ELEMENTS(pc_compat_2_7); + void gsi_handler(void *opaque, int n, int level) { GSIState *s = opaque; diff --git a/hw/i386/pc_piix.c b/hw/i386/pc_piix.c index b1fa038..182d868 100644 --- a/hw/i386/pc_piix.c +++ b/hw/i386/pc_piix.c @@ -514,12 +514,9 @@ DEFINE_I440FX_MACHINE(v2_8, "pc-i440fx-2.8", NULL, static void pc_i440fx_2_7_machine_options(MachineClass *m) { - static GlobalProperty compat[] = { - PC_COMPAT_2_7 - }; - pc_i440fx_2_8_machine_options(m); - compat_props_add(m->compat_props, compat, G_N_ELEMENTS(compat)); + compat_props_add(m->compat_props, hw_compat_2_7, hw_compat_2_7_len); + compat_props_add(m->compat_props, pc_compat_2_7, pc_compat_2_7_len); } DEFINE_I440FX_MACHINE(v2_7, "pc-i440fx-2.7", NULL, diff --git a/hw/i386/pc_q35.c b/hw/i386/pc_q35.c index 7e608b3..3537752 100644 --- a/hw/i386/pc_q35.c +++ b/hw/i386/pc_q35.c @@ -400,13 +400,10 @@ DEFINE_Q35_MACHINE(v2_8, "pc-q35-2.8", NULL, static void pc_q35_2_7_machine_options(MachineClass *m) { - static GlobalProperty compat[] = { - PC_COMPAT_2_7 - }; - pc_q35_2_8_machine_options(m); m->max_cpus = 255; - compat_props_add(m->compat_props, compat, G_N_ELEMENTS(compat)); + compat_props_add(m->compat_props, hw_compat_2_7, hw_compat_2_7_len); + compat_props_add(m->compat_props, pc_compat_2_7, pc_compat_2_7_len); } DEFINE_Q35_MACHINE(v2_7, "pc-q35-2.7", NULL, diff --git a/hw/ppc/spapr.c b/hw/ppc/spapr.c index a193538..c83b0c0 100644 --- a/hw/ppc/spapr.c +++ b/hw/ppc/spapr.c @@ -4223,7 +4223,6 @@ static void spapr_machine_2_7_class_options(MachineClass *mc) { sPAPRMachineClass *smc = SPAPR_MACHINE_CLASS(mc); static GlobalProperty compat[] = { - HW_COMPAT_2_7 { .driver = TYPE_SPAPR_PCI_HOST_BRIDGE, .property = "mem_win_size", @@ -4249,6 +4248,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"; + compat_props_add(mc->compat_props, hw_compat_2_7, hw_compat_2_7_len); compat_props_add(mc->compat_props, compat, G_N_ELEMENTS(compat)); smc->phb_placement = phb_placement_2_7; } diff --git a/hw/s390x/s390-virtio-ccw.c b/hw/s390x/s390-virtio-ccw.c index 22e96ab..f28feed 100644 --- a/hw/s390x/s390-virtio-ccw.c +++ b/hw/s390x/s390-virtio-ccw.c @@ -795,13 +795,10 @@ static void ccw_machine_2_7_instance_options(MachineState *machine) static void ccw_machine_2_7_class_options(MachineClass *mc) { S390CcwMachineClass *s390mc = S390_MACHINE_CLASS(mc); - static GlobalProperty compat[] = { - HW_COMPAT_2_7 - }; s390mc->cpu_model_allowed = false; ccw_machine_2_8_class_options(mc); - compat_props_add(mc->compat_props, compat, G_N_ELEMENTS(compat)); + compat_props_add(mc->compat_props, hw_compat_2_7, hw_compat_2_7_len); } DEFINE_CCW_MACHINE(2_7, "2.7", false); diff --git a/include/hw/boards.h b/include/hw/boards.h index 03278a8..ac4854d 100644 --- a/include/hw/boards.h +++ b/include/hw/boards.h @@ -309,4 +309,7 @@ extern const size_t hw_compat_2_9_len; extern GlobalProperty hw_compat_2_8[]; extern const size_t hw_compat_2_8_len; +extern GlobalProperty hw_compat_2_7[]; +extern const size_t hw_compat_2_7_len; + #endif diff --git a/include/hw/compat.h b/include/hw/compat.h index 65d6748..7ceab17 100644 --- a/include/hw/compat.h +++ b/include/hw/compat.h @@ -1,29 +1,6 @@ #ifndef HW_COMPAT_H #define HW_COMPAT_H -#define HW_COMPAT_2_7 \ - {\ - .driver = "virtio-pci",\ - .property = "page-per-vq",\ - .value = "on",\ - },{\ - .driver = "virtio-serial-device",\ - .property = "emergency-write",\ - .value = "off",\ - },{\ - .driver = "ioapic",\ - .property = "version",\ - .value = "0x11",\ - },{\ - .driver = "intel-iommu",\ - .property = "x-buggy-eim",\ - .value = "true",\ - },{\ - .driver = "virtio-pci",\ - .property = "x-ignore-backend-features",\ - .value = "on",\ - }, - #define HW_COMPAT_2_6 \ {\ .driver = "virtio-mmio",\ diff --git a/include/hw/i386/pc.h b/include/hw/i386/pc.h index 12c47d2..504fbc7 100644 --- a/include/hw/i386/pc.h +++ b/include/hw/i386/pc.h @@ -315,38 +315,8 @@ extern const size_t pc_compat_2_9_len; extern GlobalProperty pc_compat_2_8[]; extern const size_t pc_compat_2_8_len; -#define PC_COMPAT_2_7 \ - HW_COMPAT_2_7 \ - {\ - .driver = TYPE_X86_CPU,\ - .property = "l3-cache",\ - .value = "off",\ - },\ - {\ - .driver = TYPE_X86_CPU,\ - .property = "full-cpuid-auto-level",\ - .value = "off",\ - },\ - {\ - .driver = "Opteron_G3" "-" TYPE_X86_CPU,\ - .property = "family",\ - .value = "15",\ - },\ - {\ - .driver = "Opteron_G3" "-" TYPE_X86_CPU,\ - .property = "model",\ - .value = "6",\ - },\ - {\ - .driver = "Opteron_G3" "-" TYPE_X86_CPU,\ - .property = "stepping",\ - .value = "1",\ - },\ - {\ - .driver = "isa-pcspk",\ - .property = "migrate",\ - .value = "off",\ - }, +extern GlobalProperty pc_compat_2_7[]; +extern const size_t pc_compat_2_7_len; #define PC_COMPAT_2_6 \ HW_COMPAT_2_6 \ |