From: Shannon Zhao <zhaoshenglong@huawei.com>
To: qemu-arm@nongnu.org, peter.maydell@linaro.org, p.fedin@samsung.com
Cc: hangaohuai@huawei.com, zhaoshenglong@huawei.com,
qemu-devel@nongnu.org, peter.huangpeng@huawei.com
Subject: [Qemu-devel] [RFC PATCH 2/2] ARM: Virt: ACPI: Add GIC ITS description in ACPI MADT table
Date: Sun, 29 Nov 2015 16:22:50 +0800 [thread overview]
Message-ID: <1448785370-12176-3-git-send-email-zhaoshenglong@huawei.com> (raw)
In-Reply-To: <1448785370-12176-1-git-send-email-zhaoshenglong@huawei.com>
From: Shannon Zhao <shannon.zhao@linaro.org>
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 <shannon.zhao@linaro.org>
---
hw/arm/virt-acpi-build.c | 11 +++++++++++
1 file changed, 11 insertions(+)
diff --git a/hw/arm/virt-acpi-build.c b/hw/arm/virt-acpi-build.c
index 3c2c5d6..f200086 100644
--- a/hw/arm/virt-acpi-build.c
+++ b/hw/arm/virt-acpi-build.c
@@ -41,6 +41,7 @@
#include "hw/acpi/aml-build.h"
#include "hw/pci/pcie_host.h"
#include "hw/pci/pci.h"
+#include "kvm_arm.h"
#define ARM_SPI_BASE 32
@@ -440,6 +441,7 @@ build_madt(GArray *table_data, GArray *linker, VirtGuestInfo *guest_info,
AcpiMultipleApicTable *madt;
AcpiMadtGenericDistributor *gicd;
AcpiMadtGenericMsiFrame *gic_msi;
+ AcpiMadtGenericTranslator *gic_its;
int i;
madt = acpi_data_push(table_data, sizeof *madt);
@@ -475,6 +477,15 @@ build_madt(GArray *table_data, GArray *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.0.4
next prev parent reply other threads:[~2015-11-29 8:23 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-11-29 8:22 [Qemu-devel] [RFC PATCH 0/2] Add GIC ITS description in ACPI MADT table Shannon Zhao
2015-11-29 8:22 ` [Qemu-devel] [RFC PATCH 1/2] ACPI: Add GIC Interrupt Translation Service Structure definition Shannon Zhao
2015-11-29 8:22 ` Shannon Zhao [this message]
2015-12-18 15:12 ` [Qemu-devel] [RFC PATCH 0/2] Add GIC ITS description in ACPI MADT table Peter Maydell
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1448785370-12176-3-git-send-email-zhaoshenglong@huawei.com \
--to=zhaoshenglong@huawei.com \
--cc=hangaohuai@huawei.com \
--cc=p.fedin@samsung.com \
--cc=peter.huangpeng@huawei.com \
--cc=peter.maydell@linaro.org \
--cc=qemu-arm@nongnu.org \
--cc=qemu-devel@nongnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).