• I
    pc: acpi: drop intermediate PCMachineState.node_cpu · 1f3aba37
    Igor Mammedov 提交于
    PCMachineState.node_cpu was used for mapping APIC ID
    to numa node id as CPU entries in SRAT used to be
    built on sparse APIC ID bitmap (up to apic_id_limit).
    However since commit
      5803fce3 pc: acpi: SRAT: create only valid processor lapic entries
    CPU entries in SRAT aren't build using apic bitmap
    but using 0..maxcpus index instead which is also used
    for creating numa_info[x].node_cpu map.
    So instead of doing useless intermediate conversion from
      1. node by cpu index -> node by apic id
           i.e. numa_info[x].node_cpu -> PCMachineState.node_cpu
      2. apic id -> srat entry PMX
           PCMachineState.node_cpu[apic id] -> PMX value
    use numa_info[x].node_cpu map directly like ARM does and do
      1. numa_info[x].node_cpu -> PMX value using index
         in range 0..maxcpus
    and drop not necessary PCMachineState.node_cpu and related
    code.
    
    That also removes the last (not counting legacy hotplug)
    dependency of ACPI code on apic_id_limit and need to allocate
    huge sparse PCMachineState.node_cpu array in case of 32-bit
    APIC IDs.
    Signed-off-by: NIgor Mammedov <imammedo@redhat.com>
    Reviewed-by: NMichael S. Tsirkin <mst@redhat.com>
    Signed-off-by: NMichael S. Tsirkin <mst@redhat.com>
    1f3aba37
pc.h 24.3 KB