qemu/hw/i386
Igor Mammedov 725dfa851f x86: do not advertise die-id in query-hotpluggbale-cpus if '-smp dies' is not set
Commit 176d2cda0 (i386/cpu: Consolidate die-id validity in smp context) added
new 'die-id' topology property to CPUs and exposed it via QMP command
query-hotpluggable-cpus, which broke -device/device_add cpu-foo for existing
users that do not support die-id/dies yet. That's would be fine if it happened
to new machine type only but it also happened to old machine types,
which breaks migration from old QEMU to the new one, for example following CLI:

  OLD-QEMU -M pc-i440fx-4.0 -smp 1,max_cpus=2 \
           -device qemu64-x86_64-cpu,socket-id=1,core-id=0,thread-id
is not able to start with new QEMU, complaining about invalid die-id.

After discovering regression, the patch
   "pc: Don't make die-id mandatory unless necessary"
makes die-id optional so old CLI would work.

However it's not enough as new QEMU still exposes die-id via query-hotpluggbale-cpus
QMP command, so the users that started old machine type on new QEMU, using all
properties (including die-id) received from QMP command (as required), won't be
able to start old QEMU using the same properties since it doesn't support die-id.

Fix it by hiding die-id in query-hotpluggbale-cpus for all machine types in case
'-smp dies' is not provided on CLI or -smp dies = 1', in which case smp_dies == 1
and APIC ID is calculated in default way (as it was before DIE support) so we won't
need compat code as in both cases the topology provided to guest via CPUID is the same.

Signed-off-by: Igor Mammedov <imammedo@redhat.com>
Message-Id: <20190902120222.6179-1-imammedo@redhat.com>
Reviewed-by: Eduardo Habkost <ehabkost@redhat.com>
Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
(cherry picked from commit c6c1bb89fb)
Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
2019-10-27 23:50:01 -05:00
..
kvm Include qemu/module.h where needed, drop it from qemu-common.h 2019-06-12 13:18:33 +02:00
xen hw/i386: Replace global smp variables with machine smp properties 2019-07-05 17:08:03 -03:00
acpi-build.c i386/acpi: show PCI Express bus on pxb-pcie expanders 2019-07-25 04:17:35 -04:00
acpi-build.h
amd_iommu.c Categorize devices: iommu 2019-04-25 14:52:28 -03:00
amd_iommu.h Clean up ill-advised or unusual header guards 2019-05-13 08:58:55 +02:00
fw_cfg.c hw/i386: Implement fw_cfg_arch_key_name() 2019-05-23 14:10:31 +02:00
fw_cfg.h hw/i386: Extract fw_cfg definitions to local "fw_cfg.h" 2019-05-23 14:10:31 +02:00
intel_iommu.c intel_iommu: Fix unexpected unmaps during global unmap 2019-07-05 22:16:46 +02:00
intel_iommu_internal.h intel_iommu: Drop extended root field 2019-04-02 11:49:14 -04:00
Kconfig hw/i386: also turn off VMMOUSE is VMPORT is disabled 2019-07-23 15:53:25 +01:00
kvmvapic.c hw/i386: Replace global smp variables with machine smp properties 2019-07-05 17:08:03 -03:00
Makefile.objs hw/i386: Implement fw_cfg_arch_key_name() 2019-05-23 14:10:31 +02:00
multiboot.c elf: Add optional function ptr to load_elf() to parse ELF notes 2019-02-05 16:50:16 +01:00
multiboot.h
pc.c x86: do not advertise die-id in query-hotpluggbale-cpus if '-smp dies' is not set 2019-10-27 23:50:01 -05:00
pc_piix.c Bugfixes. 2019-07-08 10:26:18 +01:00
pc_q35.c i386: Make unversioned CPU models be aliases 2019-07-05 17:08:04 -03:00
pc_sysfw.c Include qemu-common.h exactly where needed 2019-06-12 13:20:20 +02:00
trace-events intel_iommu: Drop extended root field 2019-04-02 11:49:14 -04:00
vmmouse.c hw/input/i8042: Extract declarations from i386/pc.h into input/i8042.h 2018-03-12 16:12:48 +01:00
vmport.c hw/input/i8042: Extract declarations from i386/pc.h into input/i8042.h 2018-03-12 16:12:48 +01:00
x86-iommu.c x86-iommu: turn on IR by default if proper 2018-12-20 13:25:11 -05:00