diff options
author | Eduardo Habkost <ehabkost@redhat.com> | 2016-04-09 16:26:38 -0300 |
---|---|---|
committer | Eduardo Habkost <ehabkost@redhat.com> | 2016-05-23 13:19:36 -0300 |
commit | cd6c1b7057bc897675897f44d15277c3a6e7b118 (patch) | |
tree | 87c025a96b829aaac128d1fc32a621bfb142fafa /include | |
parent | d494352c2f7818aeba184a8ef757569083740bb2 (diff) |
pc: Set CPU model-id on compat_props for pc <= 2.4
Instead of relying on x86_cpudef_setup() calling
qemu_hw_version(), just make old machines set model-id explicitly
on compat_props for qemu64, qemu32, and athlon. This will allow
us to eliminate x86_cpudef_setup() later.
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
Diffstat (limited to 'include')
-rw-r--r-- | include/hw/i386/pc.h | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/include/hw/i386/pc.h b/include/hw/i386/pc.h index 367b6dbf0e..9ca23098bd 100644 --- a/include/hw/i386/pc.h +++ b/include/hw/i386/pc.h @@ -359,8 +359,29 @@ bool e820_get_entry(int, uint32_t, uint64_t *, uint64_t *); #define PC_COMPAT_2_5 \ HW_COMPAT_2_5 +/* Helper for setting model-id for CPU models that changed model-id + * depending on QEMU versions up to QEMU 2.4. + */ +#define PC_CPU_MODEL_IDS(v) \ + {\ + .driver = "qemu32-" TYPE_X86_CPU,\ + .property = "model-id",\ + .value = "QEMU Virtual CPU version " v,\ + },\ + {\ + .driver = "qemu64-" TYPE_X86_CPU,\ + .property = "model-id",\ + .value = "QEMU Virtual CPU version " v,\ + },\ + {\ + .driver = "athlon-" TYPE_X86_CPU,\ + .property = "model-id",\ + .value = "QEMU Virtual CPU version " v,\ + }, + #define PC_COMPAT_2_4 \ HW_COMPAT_2_4 \ + PC_CPU_MODEL_IDS("2.4.0") \ {\ .driver = "Haswell-" TYPE_X86_CPU,\ .property = "abm",\ @@ -431,6 +452,7 @@ bool e820_get_entry(int, uint32_t, uint64_t *, uint64_t *); #define PC_COMPAT_2_3 \ HW_COMPAT_2_3 \ + PC_CPU_MODEL_IDS("2.3.0") \ {\ .driver = TYPE_X86_CPU,\ .property = "arat",\ @@ -511,6 +533,7 @@ bool e820_get_entry(int, uint32_t, uint64_t *, uint64_t *); #define PC_COMPAT_2_2 \ HW_COMPAT_2_2 \ + PC_CPU_MODEL_IDS("2.3.0") \ {\ .driver = "kvm64" "-" TYPE_X86_CPU,\ .property = "vme",\ @@ -604,6 +627,7 @@ bool e820_get_entry(int, uint32_t, uint64_t *, uint64_t *); #define PC_COMPAT_2_1 \ HW_COMPAT_2_1 \ + PC_CPU_MODEL_IDS("2.1.0") \ {\ .driver = "coreduo" "-" TYPE_X86_CPU,\ .property = "vmx",\ @@ -616,6 +640,7 @@ bool e820_get_entry(int, uint32_t, uint64_t *, uint64_t *); }, #define PC_COMPAT_2_0 \ + PC_CPU_MODEL_IDS("2.0.0") \ {\ .driver = "virtio-scsi-pci",\ .property = "any_layout",\ @@ -675,6 +700,7 @@ bool e820_get_entry(int, uint32_t, uint64_t *, uint64_t *); }, #define PC_COMPAT_1_7 \ + PC_CPU_MODEL_IDS("1.7.0") \ {\ .driver = TYPE_USB_DEVICE,\ .property = "msos-desc",\ @@ -692,6 +718,7 @@ bool e820_get_entry(int, uint32_t, uint64_t *, uint64_t *); }, #define PC_COMPAT_1_6 \ + PC_CPU_MODEL_IDS("1.6.0") \ {\ .driver = "e1000",\ .property = "mitigation",\ @@ -715,6 +742,7 @@ bool e820_get_entry(int, uint32_t, uint64_t *, uint64_t *); }, #define PC_COMPAT_1_5 \ + PC_CPU_MODEL_IDS("1.5.0") \ {\ .driver = "Conroe-" TYPE_X86_CPU,\ .property = "model",\ @@ -758,6 +786,7 @@ bool e820_get_entry(int, uint32_t, uint64_t *, uint64_t *); }, #define PC_COMPAT_1_4 \ + PC_CPU_MODEL_IDS("1.4.0") \ {\ .driver = "scsi-hd",\ .property = "discard_granularity",\ |