mirror of https://github.com/xqemu/xqemu.git
pc: acpi: x2APIC support for SRAT table
Signed-off-by: Igor Mammedov <imammedo@redhat.com> Reviewed-by: Eduardo Habkost <ehabkost@redhat.com> Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
This commit is contained in:
parent
e2c9593945
commit
5eff33a2a1
|
@ -2421,7 +2421,6 @@ static void
|
||||||
build_srat(GArray *table_data, BIOSLinker *linker, MachineState *machine)
|
build_srat(GArray *table_data, BIOSLinker *linker, MachineState *machine)
|
||||||
{
|
{
|
||||||
AcpiSystemResourceAffinityTable *srat;
|
AcpiSystemResourceAffinityTable *srat;
|
||||||
AcpiSratProcessorAffinity *core;
|
|
||||||
AcpiSratMemoryAffinity *numamem;
|
AcpiSratMemoryAffinity *numamem;
|
||||||
|
|
||||||
int i;
|
int i;
|
||||||
|
@ -2441,7 +2440,10 @@ build_srat(GArray *table_data, BIOSLinker *linker, MachineState *machine)
|
||||||
|
|
||||||
for (i = 0; i < apic_ids->len; i++) {
|
for (i = 0; i < apic_ids->len; i++) {
|
||||||
int j = numa_get_node_for_cpu(i);
|
int j = numa_get_node_for_cpu(i);
|
||||||
int apic_id = apic_ids->cpus[i].arch_id;
|
uint32_t apic_id = apic_ids->cpus[i].arch_id;
|
||||||
|
|
||||||
|
if (apic_id < 255) {
|
||||||
|
AcpiSratProcessorAffinity *core;
|
||||||
|
|
||||||
core = acpi_data_push(table_data, sizeof *core);
|
core = acpi_data_push(table_data, sizeof *core);
|
||||||
core->type = ACPI_SRAT_PROCESSOR_APIC;
|
core->type = ACPI_SRAT_PROCESSOR_APIC;
|
||||||
|
@ -2453,6 +2455,18 @@ build_srat(GArray *table_data, BIOSLinker *linker, MachineState *machine)
|
||||||
memset(core->proximity_hi, 0, 3);
|
memset(core->proximity_hi, 0, 3);
|
||||||
core->local_sapic_eid = 0;
|
core->local_sapic_eid = 0;
|
||||||
core->flags = cpu_to_le32(1);
|
core->flags = cpu_to_le32(1);
|
||||||
|
} else {
|
||||||
|
AcpiSratProcessorX2ApicAffinity *core;
|
||||||
|
|
||||||
|
core = acpi_data_push(table_data, sizeof *core);
|
||||||
|
core->type = ACPI_SRAT_PROCESSOR_x2APIC;
|
||||||
|
core->length = sizeof(*core);
|
||||||
|
core->x2apic_id = cpu_to_le32(apic_id);
|
||||||
|
if (j < nb_numa_nodes) {
|
||||||
|
core->proximity_domain = cpu_to_le32(j);
|
||||||
|
}
|
||||||
|
core->flags = cpu_to_le32(1);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -503,6 +503,17 @@ struct AcpiSratProcessorAffinity
|
||||||
} QEMU_PACKED;
|
} QEMU_PACKED;
|
||||||
typedef struct AcpiSratProcessorAffinity AcpiSratProcessorAffinity;
|
typedef struct AcpiSratProcessorAffinity AcpiSratProcessorAffinity;
|
||||||
|
|
||||||
|
struct AcpiSratProcessorX2ApicAffinity {
|
||||||
|
ACPI_SUB_HEADER_DEF
|
||||||
|
uint16_t reserved;
|
||||||
|
uint32_t proximity_domain;
|
||||||
|
uint32_t x2apic_id;
|
||||||
|
uint32_t flags;
|
||||||
|
uint32_t clk_domain;
|
||||||
|
uint32_t reserved2;
|
||||||
|
} QEMU_PACKED;
|
||||||
|
typedef struct AcpiSratProcessorX2ApicAffinity AcpiSratProcessorX2ApicAffinity;
|
||||||
|
|
||||||
struct AcpiSratMemoryAffinity
|
struct AcpiSratMemoryAffinity
|
||||||
{
|
{
|
||||||
ACPI_SUB_HEADER_DEF
|
ACPI_SUB_HEADER_DEF
|
||||||
|
|
Loading…
Reference in New Issue