From patchwork Fri Jun 17 14:25:52 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Maydell X-Patchwork-Id: 9184289 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id D51F6608A2 for ; Fri, 17 Jun 2016 15:14:08 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id CCFC928396 for ; Fri, 17 Jun 2016 15:14:08 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id C1ECD2839F; Fri, 17 Jun 2016 15:14:08 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=2.0 tests=BAYES_00,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 7726028396 for ; Fri, 17 Jun 2016 15:14:08 +0000 (UTC) Received: from localhost ([::1]:58272 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bDvTD-0004MP-Hx for patchwork-qemu-devel@patchwork.kernel.org; Fri, 17 Jun 2016 11:14:07 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:50089) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bDuim-00060K-7I for qemu-devel@nongnu.org; Fri, 17 Jun 2016 10:26:09 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bDuik-0002w5-74 for qemu-devel@nongnu.org; Fri, 17 Jun 2016 10:26:07 -0400 Received: from orth.archaic.org.uk ([2001:8b0:1d0::2]:57894) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bDuik-0002vu-0A for qemu-devel@nongnu.org; Fri, 17 Jun 2016 10:26:06 -0400 Received: from pm215 by orth.archaic.org.uk with local (Exim 4.84_2) (envelope-from ) id 1bDuij-0008B0-GL for qemu-devel@nongnu.org; Fri, 17 Jun 2016 15:26:05 +0100 From: Peter Maydell To: qemu-devel@nongnu.org Date: Fri, 17 Jun 2016 15:25:52 +0100 Message-Id: <1466173552-25482-23-git-send-email-peter.maydell@linaro.org> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1466173552-25482-1-git-send-email-peter.maydell@linaro.org> References: <1466173552-25482-1-git-send-email-peter.maydell@linaro.org> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2001:8b0:1d0::2 Subject: [Qemu-devel] [PULL 22/22] ACPI: ARM: Present GIC version in MADT table X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" X-Virus-Scanned: ClamAV using ClamSMTP From: Shannon Zhao 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 Reviewed-by: Andrew Jones Message-id: 1465960955-17388-1-git-send-email-zhaoshenglong@huawei.com Signed-off-by: Peter Maydell --- hw/arm/virt-acpi-build.c | 1 + include/hw/acpi/acpi-defs.h | 4 +++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/hw/arm/virt-acpi-build.c b/hw/arm/virt-acpi-build.c index 1fa0581..28fc59c 100644 --- a/hw/arm/virt-acpi-build.c +++ b/hw/arm/virt-acpi-build.c @@ -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, diff --git a/include/hw/acpi/acpi-defs.h b/include/hw/acpi/acpi-defs.h index 850a962..ea9be0b 100644 --- a/include/hw/acpi/acpi-defs.h +++ b/include/hw/acpi/acpi-defs.h @@ -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;