qemu/hw/i386
Igor Mammedov 79e0793614 numa: cpu: calculate/set default node-ids after all -numa CLI options are parsed
Calculating default node-ids for CPUs in possible_cpu_arch_ids()
is rather fragile since defaults calculation uses nb_numa_nodes but
callback might be potentially called early before all -numa CLI
options are parsed, which would lead to cpus assigned only upto
nb_numa_nodes at the time possible_cpu_arch_ids() is called.

Issue was introduced by
(7c88e65 numa: mirror cpu to node mapping in MachineState::possible_cpus)
and for example CLI:
  -smp 4 -numa node,cpus=0 -numa node
would set props.node-id in possible_cpus array for every non
explicitly mapped CPU to the first node.

Issue is not visible to guest nor to mgmt interface due to
  1) implictly mapped cpus are forced to the first node in
     case of partial mapping
  2) in case of default mapping possible_cpu_arch_ids() is
     called after all -numa options are parsed (resulting
     in correct mapping).

However it's fragile to rely on late execution of
possible_cpu_arch_ids(), therefore add machine specific
callback that returns node-id for CPU and use it to calculate/
set defaults at machine_numa_finish_init() time when all -numa
options are parsed.

Reported-by: Eduardo Habkost <ehabkost@redhat.com>
Signed-off-by: Igor Mammedov <imammedo@redhat.com>
Message-Id: <1496314408-163972-1-git-send-email-imammedo@redhat.com>
Reviewed-by: Eduardo Habkost <ehabkost@redhat.com>
Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
2017-09-19 16:51:33 -03:00
..
kvm Convert error_report() to warn_report() 2017-07-13 13:49:58 +02:00
xen trace-events: fix code style: print 0x before hex numbers 2017-08-01 12:13:07 +01:00
acpi-build.c hw/acpi: Move acpi_set_pci_info to pcihp 2017-09-08 16:15:17 +03:00
acpi-build.h
amd_iommu.c memory/iommu: introduce IOMMUMemoryRegionClass 2017-07-14 12:04:41 +02:00
amd_iommu.h memory/iommu: introduce IOMMUMemoryRegionClass 2017-07-14 12:04:41 +02:00
intel_iommu_internal.h intel_iommu: fix iova for pt 2017-08-02 00:13:25 +03:00
intel_iommu.c intel_iommu: fix missing BQL in pt fast path 2017-09-08 16:15:17 +03:00
kvmvapic.c mttcg/i386: Patch instruction using async_safe_* framework 2017-07-14 12:04:35 +02:00
Makefile.objs
multiboot.c i386: replace g_malloc()+memcpy() with g_memdup() 2017-08-31 12:29:07 +02:00
multiboot.h
pc_piix.c pc: use generic cpu_model parsing 2017-09-19 09:09:32 -03:00
pc_q35.c pc: add 2.11 machine types 2017-09-08 16:15:17 +03:00
pc_sysfw.c hw: Use new memory_region_init_{ram, rom, rom_device}() functions 2017-07-14 17:59:42 +01:00
pc.c numa: cpu: calculate/set default node-ids after all -numa CLI options are parsed 2017-09-19 16:51:33 -03:00
pci-assign-load-rom.c memory: Rename memory_region_init_ram() to memory_region_init_ram_nomigrate() 2017-07-14 17:59:42 +01:00
trace-events docs: fix broken paths to docs/devel/tracing.txt 2017-07-31 13:12:53 +03:00
x86-iommu.c intel_iommu: support passthrough (PT) 2017-05-25 21:25:27 +03:00