* [Qemu-devel] [PATCH v2] hw/arm/virt-acpi-build: Add GICv2m description in ACPI MADT table
@ 2015-06-19 1:10 shannon.zhao
2015-06-19 12:38 ` Peter Maydell
2015-06-19 18:42 ` Andrew Jones
0 siblings, 2 replies; 4+ messages in thread
From: shannon.zhao @ 2015-06-19 1:10 UTC (permalink / raw)
To: qemu-devel, peter.maydell, imammedo, mst, christoffer.dall
Cc: shannon.zhao, zhaoshenglong
From: Shannon Zhao <shannon.zhao@linaro.org>
Add GICv2m description in ACPI MADT table, so guest can use MSI when
booting with ACPI.
Signed-off-by: Shannon Zhao <zhaoshenglong@huawei.com>
Signed-off-by: Shannon Zhao <shannon.zhao@linaro.org>
---
Fix endianness [Peter]
---
hw/arm/virt-acpi-build.c | 11 +++++++++++
include/hw/acpi/acpi-defs.h | 12 ++++++++++++
2 files changed, 23 insertions(+)
diff --git a/hw/arm/virt-acpi-build.c b/hw/arm/virt-acpi-build.c
index d5a8b9c..3652c87 100644
--- a/hw/arm/virt-acpi-build.c
+++ b/hw/arm/virt-acpi-build.c
@@ -423,8 +423,10 @@ build_madt(GArray *table_data, GArray *linker, VirtGuestInfo *guest_info,
{
int madt_start = table_data->len;
const MemMapEntry *memmap = guest_info->memmap;
+ const int *irqmap = guest_info->irqmap;
AcpiMultipleApicTable *madt;
AcpiMadtGenericDistributor *gicd;
+ AcpiMadtGenericMsiFrame *gic_msi;
int i;
madt = acpi_data_push(table_data, sizeof *madt);
@@ -448,6 +450,15 @@ build_madt(GArray *table_data, GArray *linker, VirtGuestInfo *guest_info,
gicd->length = sizeof(*gicd);
gicd->base_address = memmap[VIRT_GIC_DIST].base;
+ gic_msi = acpi_data_push(table_data, sizeof *gic_msi);
+ gic_msi->type = ACPI_APIC_GENERIC_MSI_FRAME;
+ gic_msi->length = sizeof(*gic_msi);
+ gic_msi->gic_msi_frame_id = 0;
+ gic_msi->base_address = cpu_to_le64(memmap[VIRT_GIC_V2M].base);
+ gic_msi->flags = cpu_to_le32(1);
+ gic_msi->spi_count = cpu_to_le16(NUM_GICV2M_SPIS);
+ gic_msi->spi_base = cpu_to_le16(irqmap[VIRT_GIC_V2M] + ARM_SPI_BASE);
+
build_header(linker, table_data,
(void *)(table_data->data + madt_start), "APIC",
table_data->len - madt_start, 5);
diff --git a/include/hw/acpi/acpi-defs.h b/include/hw/acpi/acpi-defs.h
index 7b4bfb7..2b431e6 100644
--- a/include/hw/acpi/acpi-defs.h
+++ b/include/hw/acpi/acpi-defs.h
@@ -372,6 +372,18 @@ struct AcpiMadtGenericDistributor {
typedef struct AcpiMadtGenericDistributor AcpiMadtGenericDistributor;
+struct AcpiMadtGenericMsiFrame {
+ ACPI_SUB_HEADER_DEF
+ uint16_t reserved;
+ uint32_t gic_msi_frame_id;
+ uint64_t base_address;
+ uint32_t flags;
+ uint16_t spi_count;
+ uint16_t spi_base;
+} QEMU_PACKED;
+
+typedef struct AcpiMadtGenericMsiFrame AcpiMadtGenericMsiFrame;
+
/*
* Generic Timer Description Table (GTDT)
*/
--
2.1.0
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [Qemu-devel] [PATCH v2] hw/arm/virt-acpi-build: Add GICv2m description in ACPI MADT table
2015-06-19 1:10 [Qemu-devel] [PATCH v2] hw/arm/virt-acpi-build: Add GICv2m description in ACPI MADT table shannon.zhao
@ 2015-06-19 12:38 ` Peter Maydell
2015-06-19 18:42 ` Andrew Jones
1 sibling, 0 replies; 4+ messages in thread
From: Peter Maydell @ 2015-06-19 12:38 UTC (permalink / raw)
To: Shannon Zhao
Cc: Igor Mammedov, Shannon Zhao, QEMU Developers, Christoffer Dall,
Michael S. Tsirkin
On 19 June 2015 at 02:10, <shannon.zhao@linaro.org> wrote:
> From: Shannon Zhao <shannon.zhao@linaro.org>
>
> Add GICv2m description in ACPI MADT table, so guest can use MSI when
> booting with ACPI.
>
> Signed-off-by: Shannon Zhao <zhaoshenglong@huawei.com>
> Signed-off-by: Shannon Zhao <shannon.zhao@linaro.org>
> ---
This looks ok, but I would like a review or ack from somebody
before I put it in target-arm.next.
thanks
-- PMM
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [Qemu-devel] [PATCH v2] hw/arm/virt-acpi-build: Add GICv2m description in ACPI MADT table
2015-06-19 1:10 [Qemu-devel] [PATCH v2] hw/arm/virt-acpi-build: Add GICv2m description in ACPI MADT table shannon.zhao
2015-06-19 12:38 ` Peter Maydell
@ 2015-06-19 18:42 ` Andrew Jones
2015-06-23 16:01 ` Peter Maydell
1 sibling, 1 reply; 4+ messages in thread
From: Andrew Jones @ 2015-06-19 18:42 UTC (permalink / raw)
To: shannon zhao
Cc: peter maydell, mst, qemu-devel, zhaoshenglong, imammedo,
christoffer dall
----- Original Message -----
> From: Shannon Zhao <shannon.zhao@linaro.org>
>
> Add GICv2m description in ACPI MADT table, so guest can use MSI when
> booting with ACPI.
>
> Signed-off-by: Shannon Zhao <zhaoshenglong@huawei.com>
> Signed-off-by: Shannon Zhao <shannon.zhao@linaro.org>
Tested-by: Andrew Jones <drjones@redhat.com>
Reviewed-by: Andrew Jones <drjones@redhat.com>
> ---
> Fix endianness [Peter]
> ---
> hw/arm/virt-acpi-build.c | 11 +++++++++++
> include/hw/acpi/acpi-defs.h | 12 ++++++++++++
> 2 files changed, 23 insertions(+)
>
> diff --git a/hw/arm/virt-acpi-build.c b/hw/arm/virt-acpi-build.c
> index d5a8b9c..3652c87 100644
> --- a/hw/arm/virt-acpi-build.c
> +++ b/hw/arm/virt-acpi-build.c
> @@ -423,8 +423,10 @@ build_madt(GArray *table_data, GArray *linker,
> VirtGuestInfo *guest_info,
> {
> int madt_start = table_data->len;
> const MemMapEntry *memmap = guest_info->memmap;
> + const int *irqmap = guest_info->irqmap;
> AcpiMultipleApicTable *madt;
> AcpiMadtGenericDistributor *gicd;
> + AcpiMadtGenericMsiFrame *gic_msi;
> int i;
>
> madt = acpi_data_push(table_data, sizeof *madt);
> @@ -448,6 +450,15 @@ build_madt(GArray *table_data, GArray *linker,
> VirtGuestInfo *guest_info,
> gicd->length = sizeof(*gicd);
> gicd->base_address = memmap[VIRT_GIC_DIST].base;
>
> + gic_msi = acpi_data_push(table_data, sizeof *gic_msi);
> + gic_msi->type = ACPI_APIC_GENERIC_MSI_FRAME;
> + gic_msi->length = sizeof(*gic_msi);
> + gic_msi->gic_msi_frame_id = 0;
> + gic_msi->base_address = cpu_to_le64(memmap[VIRT_GIC_V2M].base);
> + gic_msi->flags = cpu_to_le32(1);
> + gic_msi->spi_count = cpu_to_le16(NUM_GICV2M_SPIS);
> + gic_msi->spi_base = cpu_to_le16(irqmap[VIRT_GIC_V2M] + ARM_SPI_BASE);
> +
> build_header(linker, table_data,
> (void *)(table_data->data + madt_start), "APIC",
> table_data->len - madt_start, 5);
> diff --git a/include/hw/acpi/acpi-defs.h b/include/hw/acpi/acpi-defs.h
> index 7b4bfb7..2b431e6 100644
> --- a/include/hw/acpi/acpi-defs.h
> +++ b/include/hw/acpi/acpi-defs.h
> @@ -372,6 +372,18 @@ struct AcpiMadtGenericDistributor {
>
> typedef struct AcpiMadtGenericDistributor AcpiMadtGenericDistributor;
>
> +struct AcpiMadtGenericMsiFrame {
> + ACPI_SUB_HEADER_DEF
> + uint16_t reserved;
> + uint32_t gic_msi_frame_id;
> + uint64_t base_address;
> + uint32_t flags;
> + uint16_t spi_count;
> + uint16_t spi_base;
> +} QEMU_PACKED;
> +
> +typedef struct AcpiMadtGenericMsiFrame AcpiMadtGenericMsiFrame;
> +
> /*
> * Generic Timer Description Table (GTDT)
> */
> --
> 2.1.0
>
>
>
>
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [Qemu-devel] [PATCH v2] hw/arm/virt-acpi-build: Add GICv2m description in ACPI MADT table
2015-06-19 18:42 ` Andrew Jones
@ 2015-06-23 16:01 ` Peter Maydell
0 siblings, 0 replies; 4+ messages in thread
From: Peter Maydell @ 2015-06-23 16:01 UTC (permalink / raw)
To: Andrew Jones
Cc: Michael S. Tsirkin, QEMU Developers, shannon zhao, Shannon Zhao,
Igor Mammedov, christoffer dall
On 19 June 2015 at 19:42, Andrew Jones <drjones@redhat.com> wrote:
>
>
> ----- Original Message -----
>> From: Shannon Zhao <shannon.zhao@linaro.org>
>>
>> Add GICv2m description in ACPI MADT table, so guest can use MSI when
>> booting with ACPI.
>>
>> Signed-off-by: Shannon Zhao <zhaoshenglong@huawei.com>
>> Signed-off-by: Shannon Zhao <shannon.zhao@linaro.org>
>
> Tested-by: Andrew Jones <drjones@redhat.com>
> Reviewed-by: Andrew Jones <drjones@redhat.com>
Applied to target-arm.next, thanks.
-- PMM
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2015-06-23 16:01 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-06-19 1:10 [Qemu-devel] [PATCH v2] hw/arm/virt-acpi-build: Add GICv2m description in ACPI MADT table shannon.zhao
2015-06-19 12:38 ` Peter Maydell
2015-06-19 18:42 ` Andrew Jones
2015-06-23 16:01 ` Peter Maydell
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.