qemu-e2k/hw/ppc
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
..
e500-ccsr.h
e500.c cpu: make cpu_generic_init() abort QEMU on error 2017-09-19 09:09:32 -03:00
e500.h
e500plat.c
fdt.c
mac_newworld.c cpu: make cpu_generic_init() abort QEMU on error 2017-09-19 09:09:32 -03:00
mac_oldworld.c cpu: make cpu_generic_init() abort QEMU on error 2017-09-19 09:09:32 -03:00
mac.h
Makefile.objs ppc4xx_i2c: Move to hw/i2c 2017-09-08 09:30:55 +10:00
mpc8544_guts.c
mpc8544ds.c
pnv_bmc.c
pnv_core.c pnv-core: use get_uint() for "core-pir" property 2017-06-20 14:31:33 +02:00
pnv_lpc.c
pnv_occ.c
pnv_psi.c
pnv_xscom.c
pnv.c Convert error_report() to warn_report() 2017-07-13 13:49:58 +02:00
ppc4xx_devs.c cpu: make cpu_generic_init() abort QEMU on error 2017-09-19 09:09:32 -03:00
ppc4xx_pci.c
ppc405_boards.c hw: Use new memory_region_init_{ram, rom, rom_device}() functions 2017-07-14 17:59:42 +01:00
ppc405_uc.c ppc4xx: Export ECB and PLB emulation 2017-09-08 09:30:55 +10:00
ppc405.h ppc4xx: Export ECB and PLB emulation 2017-09-08 09:30:55 +10:00
ppc440_bamboo.c cpu: make cpu_generic_init() abort QEMU on error 2017-09-19 09:09:32 -03:00
ppc_booke.c
ppc.c ppc: spapr: Make VCPU ID handling private to SPAPR 2017-09-08 09:30:55 +10:00
ppce500_spin.c
prep_systemio.c
prep.c cpu: make cpu_generic_init() abort QEMU on error 2017-09-19 09:09:32 -03:00
rs6000_mc.c
spapr_cpu_core.c spapr_cpu_core: cleaning up qdev_get_machine() calls 2017-09-15 10:29:48 +10:00
spapr_drc.c spapr_drc: pass object ownership to parent/owner 2017-09-08 09:30:54 +10:00
spapr_events.c spapr_events: use QTAILQ_FOREACH_SAFE() in spapr_clear_pending_events() 2017-09-15 10:29:48 +10:00
spapr_hcall.c spapr: fix CAS-generated reset 2017-09-15 10:29:48 +10:00
spapr_iommu.c spapr_iommu: Realloc guest visible TCE table when hot(un)plugging vfio-pci 2017-09-08 09:30:55 +10:00
spapr_ovec.c
spapr_pci_vfio.c
spapr_pci.c spapr_pci: don't create 64-bit MMIO window if we don't need to 2017-09-15 10:29:48 +10:00
spapr_rng.c spapr_rng: Convert to DEFINE_PROP_LINK 2017-07-14 12:04:43 +02:00
spapr_rtas_ddw.c
spapr_rtas.c ppc: spapr: Make VCPU ID handling private to SPAPR 2017-09-08 09:30:55 +10:00
spapr_rtc.c hw/ppc/spapr_rtc: Mark the RTC device with user_creatable = false 2017-08-22 21:26:46 +10:00
spapr_vio.c vmstate: error hint for failed equal checks 2017-06-28 11:18:44 +02:00
spapr.c numa: cpu: calculate/set default node-ids after all -numa CLI options are parsed 2017-09-19 16:51:33 -03:00
trace-events trace-events: fix code style: print 0x before hex numbers 2017-08-01 12:13:07 +01:00
virtex_ml507.c cpu: make cpu_generic_init() abort QEMU on error 2017-09-19 09:09:32 -03:00