mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-02 23:33:54 -06:00
numa: make sure that all cpus have has_node_id set if numa is enabled
It fixes/add missing _PXM object for non mapped CPU (x86) and missing fdt node (virt-arm). It ensures that possible_cpus contains complete mapping if numa is enabled by the time machine_init() is executed. As result non completely mapped CPUs: 1) appear in ACPI/fdt blobs 2) QMP query-hotpluggable-cpus command shows bound nodes for such CPUs 3) allows to drop checks for has_node_id in numa only code, reducing number of invariants incomplete mapping could produce 4) moves fixup/implicit node init from runtime numa_cpu_pre_plug() (when CPU object is created) to machine_numa_finish_init() which helps to fix [1, 2] and make possible_cpus complete source of numa mapping available even before CPUs are created. Signed-off-by: Igor Mammedov <imammedo@redhat.com> Message-Id: <1496161442-96665-4-git-send-email-imammedo@redhat.com> Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
This commit is contained in:
parent
60bed6a30a
commit
d41f3e750d
5 changed files with 18 additions and 25 deletions
|
@ -721,19 +721,23 @@ static void machine_numa_finish_init(MachineState *machine)
|
|||
const CPUArchId *cpu_slot = &possible_cpus->cpus[i];
|
||||
|
||||
if (!cpu_slot->props.has_node_id) {
|
||||
if (default_mapping) {
|
||||
/* fetch default mapping from board and enable it */
|
||||
CpuInstanceProperties props = cpu_slot->props;
|
||||
props.has_node_id = true;
|
||||
machine_set_cpu_numa_node(machine, &props, &error_fatal);
|
||||
} else {
|
||||
/* fetch default mapping from board and enable it */
|
||||
CpuInstanceProperties props = cpu_slot->props;
|
||||
|
||||
if (!default_mapping) {
|
||||
/* record slots with not set mapping,
|
||||
* TODO: make it hard error in future */
|
||||
char *cpu_str = cpu_slot_to_string(cpu_slot);
|
||||
g_string_append_printf(s, "%sCPU %d [%s]",
|
||||
s->len ? ", " : "", i, cpu_str);
|
||||
g_free(cpu_str);
|
||||
|
||||
/* non mapped cpus used to fallback to node 0 */
|
||||
props.node_id = 0;
|
||||
}
|
||||
|
||||
props.has_node_id = true;
|
||||
machine_set_cpu_numa_node(machine, &props, &error_fatal);
|
||||
}
|
||||
}
|
||||
if (s->len && !qtest_enabled()) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue