From patchwork Wed Jun 15 03:22:35 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Shannon Zhao X-Patchwork-Id: 9177413 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 EA9CD6021C for ; Wed, 15 Jun 2016 03:23:51 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id DDA282832A for ; Wed, 15 Jun 2016 03:23:51 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id CFEA828348; Wed, 15 Jun 2016 03:23:51 +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 59C102832A for ; Wed, 15 Jun 2016 03:23:51 +0000 (UTC) Received: from localhost ([::1]:39413 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bD1Qk-0001Mr-J7 for patchwork-qemu-devel@patchwork.kernel.org; Tue, 14 Jun 2016 23:23:50 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:40062) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bD1QT-0001JA-MZ for qemu-devel@nongnu.org; Tue, 14 Jun 2016 23:23:34 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bD1QP-00082m-L6 for qemu-devel@nongnu.org; Tue, 14 Jun 2016 23:23:33 -0400 Received: from szxga03-in.huawei.com ([119.145.14.66]:28222) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bD1QO-00081A-VX; Tue, 14 Jun 2016 23:23:29 -0400 Received: from 172.24.1.36 (EHLO szxeml422-hub.china.huawei.com) ([172.24.1.36]) by szxrg03-dlp.huawei.com (MOS 4.4.3-GA FastPath queued) with ESMTP id CDI00525; Wed, 15 Jun 2016 11:23:08 +0800 (CST) Received: from HGHY1Z002260041.china.huawei.com (10.177.16.142) by szxeml422-hub.china.huawei.com (10.82.67.152) with Microsoft SMTP Server id 14.3.235.1; Wed, 15 Jun 2016 11:22:55 +0800 From: Shannon Zhao To: , Date: Wed, 15 Jun 2016 11:22:35 +0800 Message-ID: <1465960955-17388-1-git-send-email-zhaoshenglong@huawei.com> X-Mailer: git-send-email 1.9.0.msysgit.0 MIME-Version: 1.0 X-Originating-IP: [10.177.16.142] X-CFilter-Loop: Reflected X-Mirapoint-Virus-RAPID-Raw: score=unknown(0), refid=str=0001.0A090201.5760CA1E.0056, ss=1, re=0.000, recu=0.000, reip=0.000, cl=1, cld=1, fgs=0, ip=0.0.0.0, so=2013-05-26 15:14:31, dmn=2013-03-21 17:37:32 X-Mirapoint-Loop-Id: d3f64a939f1a55c256bd885785eceb0e X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.4.x-2.6.x [generic] X-Received-From: 119.145.14.66 Subject: [Qemu-devel] [PATCH] 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: , Cc: imammedo@redhat.com, peter.huangpeng@huawei.com, zhaoshenglong@huawei.com, qemu-devel@nongnu.org, shannon.zhao@linaro.org 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 --- 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;