diff options
author | Marc-André Lureau <marcandre.lureau@redhat.com> | 2018-12-12 19:36:30 +0400 |
---|---|---|
committer | Marc-André Lureau <marcandre.lureau@redhat.com> | 2019-01-07 16:18:42 +0400 |
commit | 8995dd9009a4f0845393c102098dc94e14806c37 (patch) | |
tree | 0b2e85cd0acce6dabe85b68109f027e47011bd0d /hw/i386 | |
parent | 2f99b9c273ded76211ddb445b273ce854d469033 (diff) |
compat: replace PC_COMPAT_2_3 & HW_COMPAT_2_3 macros
Use static arrays instead. I decided to rename the conflicting
pc_compat_2_3() function with pc_compat_2_3_fn().
Suggested-by: Eduardo Habkost <ehabkost@redhat.com>
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Reviewed-by: Igor Mammedov <imammedo@redhat.com>
Reviewed-by: Cornelia Huck <cohuck@redhat.com>
Acked-by: Eduardo Habkost <ehabkost@redhat.com>
Diffstat (limited to 'hw/i386')
-rw-r--r-- | hw/i386/pc.c | 86 | ||||
-rw-r--r-- | hw/i386/pc_piix.c | 13 |
2 files changed, 91 insertions, 8 deletions
diff --git a/hw/i386/pc.c b/hw/i386/pc.c index cc14cb42d5..1f6d7809ce 100644 --- a/hw/i386/pc.c +++ b/hw/i386/pc.c @@ -355,6 +355,92 @@ GlobalProperty pc_compat_2_4[] = { }; const size_t pc_compat_2_4_len = G_N_ELEMENTS(pc_compat_2_4); +GlobalProperty pc_compat_2_3[] = { + PC_CPU_MODEL_IDS("2.3.0") + { + .driver = TYPE_X86_CPU, + .property = "arat", + .value = "off", + },{ + .driver = "qemu64" "-" TYPE_X86_CPU, + .property = "min-level", + .value = stringify(4), + },{ + .driver = "kvm64" "-" TYPE_X86_CPU, + .property = "min-level", + .value = stringify(5), + },{ + .driver = "pentium3" "-" TYPE_X86_CPU, + .property = "min-level", + .value = stringify(2), + },{ + .driver = "n270" "-" TYPE_X86_CPU, + .property = "min-level", + .value = stringify(5), + },{ + .driver = "Conroe" "-" TYPE_X86_CPU, + .property = "min-level", + .value = stringify(4), + },{ + .driver = "Penryn" "-" TYPE_X86_CPU, + .property = "min-level", + .value = stringify(4), + },{ + .driver = "Nehalem" "-" TYPE_X86_CPU, + .property = "min-level", + .value = stringify(4), + },{ + .driver = "n270" "-" TYPE_X86_CPU, + .property = "min-xlevel", + .value = stringify(0x8000000a), + },{ + .driver = "Penryn" "-" TYPE_X86_CPU, + .property = "min-xlevel", + .value = stringify(0x8000000a), + },{ + .driver = "Conroe" "-" TYPE_X86_CPU, + .property = "min-xlevel", + .value = stringify(0x8000000a), + },{ + .driver = "Nehalem" "-" TYPE_X86_CPU, + .property = "min-xlevel", + .value = stringify(0x8000000a), + },{ + .driver = "Westmere" "-" TYPE_X86_CPU, + .property = "min-xlevel", + .value = stringify(0x8000000a), + },{ + .driver = "SandyBridge" "-" TYPE_X86_CPU, + .property = "min-xlevel", + .value = stringify(0x8000000a), + },{ + .driver = "IvyBridge" "-" TYPE_X86_CPU, + .property = "min-xlevel", + .value = stringify(0x8000000a), + },{ + .driver = "Haswell" "-" TYPE_X86_CPU, + .property = "min-xlevel", + .value = stringify(0x8000000a), + },{ + .driver = "Haswell-noTSX" "-" TYPE_X86_CPU, + .property = "min-xlevel", + .value = stringify(0x8000000a), + },{ + .driver = "Broadwell" "-" TYPE_X86_CPU, + .property = "min-xlevel", + .value = stringify(0x8000000a), + },{ + .driver = "Broadwell-noTSX" "-" TYPE_X86_CPU, + .property = "min-xlevel", + .value = stringify(0x8000000a), + },{ + .driver = TYPE_X86_CPU, + .property = "kvm-no-smi-migration", + .value = "on", + }, +}; +const size_t pc_compat_2_3_len = G_N_ELEMENTS(pc_compat_2_3); + 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 125ab600ef..5b03f9ef80 100644 --- a/hw/i386/pc_piix.c +++ b/hw/i386/pc_piix.c @@ -310,7 +310,7 @@ static void pc_init1(MachineState *machine, * HW_COMPAT_*, PC_COMPAT_*, or * pc_*_machine_options(). */ -static void pc_compat_2_3(MachineState *machine) +static void pc_compat_2_3_fn(MachineState *machine) { PCMachineState *pcms = PC_MACHINE(machine); if (kvm_enabled()) { @@ -320,7 +320,7 @@ static void pc_compat_2_3(MachineState *machine) static void pc_compat_2_2(MachineState *machine) { - pc_compat_2_3(machine); + pc_compat_2_3_fn(machine); } static void pc_compat_2_1(MachineState *machine) @@ -566,16 +566,13 @@ DEFINE_I440FX_MACHINE(v2_4, "pc-i440fx-2.4", NULL, static void pc_i440fx_2_3_machine_options(MachineClass *m) { - static GlobalProperty compat[] = { - PC_COMPAT_2_3 - }; - pc_i440fx_2_4_machine_options(m); m->hw_version = "2.3.0"; - compat_props_add(m->compat_props, compat, G_N_ELEMENTS(compat)); + compat_props_add(m->compat_props, hw_compat_2_3, hw_compat_2_3_len); + compat_props_add(m->compat_props, pc_compat_2_3, pc_compat_2_3_len); } -DEFINE_I440FX_MACHINE(v2_3, "pc-i440fx-2.3", pc_compat_2_3, +DEFINE_I440FX_MACHINE(v2_3, "pc-i440fx-2.3", pc_compat_2_3_fn, pc_i440fx_2_3_machine_options); static void pc_i440fx_2_2_machine_options(MachineClass *m) |