From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:60029) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1brP3w-00006o-5u for qemu-devel@nongnu.org; Tue, 04 Oct 2016 08:43:14 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1brP3r-0006Pd-Qi for qemu-devel@nongnu.org; Tue, 04 Oct 2016 08:43:11 -0400 Received: from orth.archaic.org.uk ([2001:8b0:1d0::2]:47190) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1brP3r-0006Ob-K4 for qemu-devel@nongnu.org; Tue, 04 Oct 2016 08:43:07 -0400 Received: from pm215 by orth.archaic.org.uk with local (Exim 4.84_2) (envelope-from ) id 1brP3r-0005qx-2w for qemu-devel@nongnu.org; Tue, 04 Oct 2016 13:43:07 +0100 From: Peter Maydell Date: Tue, 4 Oct 2016 13:42:50 +0100 Message-Id: <1475584975-25099-23-git-send-email-peter.maydell@linaro.org> In-Reply-To: <1475584975-25099-1-git-send-email-peter.maydell@linaro.org> References: <1475584975-25099-1-git-send-email-peter.maydell@linaro.org> Subject: [Qemu-devel] [PULL 22/27] ARM: Virt: ACPI: Add GIC ITS description in ACPI MADT table List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org From: Shannon Zhao If GIC ITS is supported, add description in ACPI MADT table, then guest could use ITS when booting with ACPI. Signed-off-by: Shannon Zhao Signed-off-by: Eric Auger Message-id: 1474616617-366-9-git-send-email-eric.auger@redhat.com Signed-off-by: Peter Maydell --- hw/arm/virt-acpi-build.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/hw/arm/virt-acpi-build.c b/hw/arm/virt-acpi-build.c index 295ec86..7b39b1d 100644 --- a/hw/arm/virt-acpi-build.c +++ b/hw/arm/virt-acpi-build.c @@ -44,6 +44,7 @@ #include "hw/pci/pcie_host.h" #include "hw/pci/pci.h" #include "sysemu/numa.h" +#include "kvm_arm.h" #define ARM_SPI_BASE 32 #define ACPI_POWER_BUTTON_DEVICE "PWRB" @@ -546,6 +547,7 @@ build_madt(GArray *table_data, BIOSLinker *linker, VirtGuestInfo *guest_info) } if (guest_info->gic_version == 3) { + AcpiMadtGenericTranslator *gic_its; AcpiMadtGenericRedistributor *gicr = acpi_data_push(table_data, sizeof *gicr); @@ -553,6 +555,16 @@ build_madt(GArray *table_data, BIOSLinker *linker, VirtGuestInfo *guest_info) gicr->length = sizeof(*gicr); gicr->base_address = cpu_to_le64(memmap[VIRT_GIC_REDIST].base); gicr->range_length = cpu_to_le32(memmap[VIRT_GIC_REDIST].size); + + if (!its_class_name()) { + return; + } + + gic_its = acpi_data_push(table_data, sizeof *gic_its); + gic_its->type = ACPI_APIC_GENERIC_TRANSLATOR; + gic_its->length = sizeof(*gic_its); + gic_its->translation_id = 0; + gic_its->base_address = cpu_to_le64(memmap[VIRT_GIC_ITS].base); } else { gic_msi = acpi_data_push(table_data, sizeof *gic_msi); gic_msi->type = ACPI_APIC_GENERIC_MSI_FRAME; -- 2.7.4