ACPI: ARM: Present GIC version in MADT table
authorShannon Zhao <shannon.zhao@linaro.org>
Fri, 17 Jun 2016 14:23:48 +0000 (15:23 +0100)
committerPeter Maydell <peter.maydell@linaro.org>
Fri, 17 Jun 2016 14:23:51 +0000 (15:23 +0100)
In ACPI 5.1 Errata, it adds GIC version in GIC distributor structure.
This is useful for guest kernel to identify which version GIC hardware
is. Update GIC distributor structure and present GIC version in MADT
table.

Signed-off-by: Shannon Zhao <shannon.zhao@linaro.org>
Reviewed-by: Andrew Jones <drjones@redhat.com>
Message-id: 1465960955-17388-1-git-send-email-zhaoshenglong@huawei.com
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
hw/arm/virt-acpi-build.c
include/hw/acpi/acpi-defs.h

index 1fa0581e3363f13210b28834103aadb928459c58..28fc59c6657bed00ddc2dbbceda5ae9cabace467 100644 (file)
@@ -523,6 +523,7 @@ build_madt(GArray *table_data, BIOSLinker *linker, VirtGuestInfo *guest_info)
     gicd->type = ACPI_APIC_GENERIC_DISTRIBUTOR;
     gicd->length = sizeof(*gicd);
     gicd->base_address = memmap[VIRT_GIC_DIST].base;
+    gicd->version = guest_info->gic_version;
 
     for (i = 0; i < guest_info->smp_cpus; i++) {
         AcpiMadtGenericInterrupt *gicc = acpi_data_push(table_data,
index 850a9626b7615fd4314fa59b0a61f8a551bcd896..ea9be0bdb1d59e4fc58c9670c18c401e527a0717 100644 (file)
@@ -367,7 +367,9 @@ struct AcpiMadtGenericDistributor {
     uint32_t gic_id;
     uint64_t base_address;
     uint32_t global_irq_base;
-    uint32_t reserved2;
+    /* ACPI 5.1 Errata 1228 Present GIC version in MADT table */
+    uint8_t version;
+    uint8_t reserved2[3];
 } QEMU_PACKED;
 
 typedef struct AcpiMadtGenericDistributor AcpiMadtGenericDistributor;