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: 70075 Delivered-To: patch@linaro.org Received: by 10.140.106.246 with SMTP id e109csp2358638qgf; Tue, 14 Jun 2016 20:24:38 -0700 (PDT) X-Received: by 10.237.36.108 with SMTP id s41mr19492314qtc.66.1465961078283; Tue, 14 Jun 2016 20:24:38 -0700 (PDT) Return-Path: Received: from lists.gnu.org (lists.gnu.org. [2001:4830:134:3::11]) by mx.google.com with ESMTPS id l62si11777896qtd.117.2016.06.14.20.24.38 for (version=TLS1 cipher=AES128-SHA bits=128/128); Tue, 14 Jun 2016 20:24:38 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 2001:4830:134:3::11 as permitted sender) client-ip=2001:4830:134:3::11; Authentication-Results: mx.google.com; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 2001:4830:134:3::11 as permitted sender) smtp.mailfrom=qemu-devel-bounces+patch=linaro.org@nongnu.org Received: from localhost ([::1]:39415 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bD1RV-0001kZ-T2 for patch@linaro.org; Tue, 14 Jun 2016 23:24:37 -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+patch=linaro.org@nongnu.org Sender: "Qemu-devel" 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 --- hw/arm/virt-acpi-build.c | 1 + include/hw/acpi/acpi-defs.h | 4 +++- 2 files changed, 4 insertions(+), 1 deletion(-) -- 2.0.4 Reviewed-by: Andrew Jones 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;