mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-06 09:13:55 -06:00
numa: move numa global variable nb_numa_nodes into MachineState
Add struct NumaState in MachineState and move existing numa global nb_numa_nodes(renamed as "num_nodes") into NumaState. And add variable numa_support into MachineClass to decide which submachines support NUMA. Reviewed-by: Igor Mammedov <imammedo@redhat.com> Suggested-by: Igor Mammedov <imammedo@redhat.com> Suggested-by: Eduardo Habkost <ehabkost@redhat.com> Signed-off-by: Tao Xu <tao3.xu@intel.com> Message-Id: <20190809065731.9097-3-tao3.xu@intel.com> [ehabkost: include hw/boards.h again to fix build failures] Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
This commit is contained in:
parent
2744ece809
commit
aa57020774
17 changed files with 113 additions and 59 deletions
|
@ -517,7 +517,8 @@ build_srat(GArray *table_data, BIOSLinker *linker, VirtMachineState *vms)
|
|||
int i, srat_start;
|
||||
uint64_t mem_base;
|
||||
MachineClass *mc = MACHINE_GET_CLASS(vms);
|
||||
const CPUArchIdList *cpu_list = mc->possible_cpu_arch_ids(MACHINE(vms));
|
||||
MachineState *ms = MACHINE(vms);
|
||||
const CPUArchIdList *cpu_list = mc->possible_cpu_arch_ids(ms);
|
||||
|
||||
srat_start = table_data->len;
|
||||
srat = acpi_data_push(table_data, sizeof(*srat));
|
||||
|
@ -533,7 +534,7 @@ build_srat(GArray *table_data, BIOSLinker *linker, VirtMachineState *vms)
|
|||
}
|
||||
|
||||
mem_base = vms->memmap[VIRT_MEM].base;
|
||||
for (i = 0; i < nb_numa_nodes; ++i) {
|
||||
for (i = 0; i < ms->numa_state->num_nodes; ++i) {
|
||||
if (numa_info[i].node_mem > 0) {
|
||||
numamem = acpi_data_push(table_data, sizeof(*numamem));
|
||||
build_srat_memory(numamem, mem_base, numa_info[i].node_mem, i,
|
||||
|
@ -759,6 +760,7 @@ void virt_acpi_build(VirtMachineState *vms, AcpiBuildTables *tables)
|
|||
GArray *table_offsets;
|
||||
unsigned dsdt, xsdt;
|
||||
GArray *tables_blob = tables->table_data;
|
||||
MachineState *ms = MACHINE(vms);
|
||||
|
||||
table_offsets = g_array_new(false, true /* clear */,
|
||||
sizeof(uint32_t));
|
||||
|
@ -793,12 +795,12 @@ void virt_acpi_build(VirtMachineState *vms, AcpiBuildTables *tables)
|
|||
acpi_add_table(table_offsets, tables_blob);
|
||||
build_spcr(tables_blob, tables->linker, vms);
|
||||
|
||||
if (nb_numa_nodes > 0) {
|
||||
if (ms->numa_state->num_nodes > 0) {
|
||||
acpi_add_table(table_offsets, tables_blob);
|
||||
build_srat(tables_blob, tables->linker, vms);
|
||||
if (have_numa_distance) {
|
||||
acpi_add_table(table_offsets, tables_blob);
|
||||
build_slit(tables_blob, tables->linker);
|
||||
build_slit(tables_blob, tables->linker, ms);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue