All of lore.kernel.org
 help / color / mirror / Atom feed
* [Qemu-devel] [RFC PATCH 0/2] Add GIC ITS description in ACPI MADT table
@ 2015-11-29  8:22 Shannon Zhao
  2015-11-29  8:22 ` [Qemu-devel] [RFC PATCH 1/2] ACPI: Add GIC Interrupt Translation Service Structure definition Shannon Zhao
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Shannon Zhao @ 2015-11-29  8:22 UTC (permalink / raw)
  To: qemu-arm, peter.maydell, p.fedin
  Cc: hangaohuai, zhaoshenglong, qemu-devel, peter.huangpeng

From: Shannon Zhao <shannon.zhao@linaro.org>

These two patches add ITS description in ACPI MADT table. It bases on
Pavel Fedin's ITS series[1].

[1]https://www.mail-archive.com/qemu-devel@nongnu.org/msg337421.html

Shannon Zhao (2):
  ACPI: Add GIC Interrupt Translation Service Structure definition
  ARM: Virt: ACPI: Add GIC ITS description in ACPI MADT table

 hw/arm/virt-acpi-build.c    | 11 +++++++++++
 include/hw/acpi/acpi-defs.h | 13 ++++++++++++-
 2 files changed, 23 insertions(+), 1 deletion(-)

-- 
2.0.4

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [Qemu-devel] [RFC PATCH 1/2] ACPI: Add GIC Interrupt Translation Service Structure definition
  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 ` Shannon Zhao
  2015-11-29  8:22 ` [Qemu-devel] [RFC PATCH 2/2] ARM: Virt: ACPI: Add GIC ITS description in ACPI MADT table Shannon Zhao
  2015-12-18 15:12 ` [Qemu-devel] [RFC PATCH 0/2] " Peter Maydell
  2 siblings, 0 replies; 4+ messages in thread
From: Shannon Zhao @ 2015-11-29  8:22 UTC (permalink / raw)
  To: qemu-arm, peter.maydell, p.fedin
  Cc: hangaohuai, zhaoshenglong, qemu-devel, peter.huangpeng

From: Shannon Zhao <shannon.zhao@linaro.org>

ACPI Spec 6.0 introduces GIC Interrupt Translation Service Structure.
Here we add the definition of the Structure.

Signed-off-by: Shannon Zhao <shannon.zhao@linaro.org>
---
 include/hw/acpi/acpi-defs.h | 13 ++++++++++++-
 1 file changed, 12 insertions(+), 1 deletion(-)

diff --git a/include/hw/acpi/acpi-defs.h b/include/hw/acpi/acpi-defs.h
index c7a03d4..fc273ce 100644
--- a/include/hw/acpi/acpi-defs.h
+++ b/include/hw/acpi/acpi-defs.h
@@ -294,7 +294,8 @@ typedef struct AcpiMultipleApicTable AcpiMultipleApicTable;
 #define ACPI_APIC_GENERIC_DISTRIBUTOR   12
 #define ACPI_APIC_GENERIC_MSI_FRAME     13
 #define ACPI_APIC_GENERIC_REDISTRIBUTOR 14
-#define ACPI_APIC_RESERVED              15   /* 15 and greater are reserved */
+#define ACPI_APIC_GENERIC_TRANSLATOR    15
+#define ACPI_APIC_RESERVED              16   /* 16 and greater are reserved */
 
 /*
  * MADT sub-structures (Follow MULTIPLE_APIC_DESCRIPTION_TABLE)
@@ -393,6 +394,16 @@ struct AcpiMadtGenericRedistributor {
 
 typedef struct AcpiMadtGenericRedistributor AcpiMadtGenericRedistributor;
 
+struct AcpiMadtGenericTranslator {
+    ACPI_SUB_HEADER_DEF
+    uint16_t reserved;
+    uint32_t translation_id;
+    uint64_t base_address;
+    uint32_t reserved2;
+} QEMU_PACKED;
+
+typedef struct AcpiMadtGenericTranslator AcpiMadtGenericTranslator;
+
 /*
  * Generic Timer Description Table (GTDT)
  */
-- 
2.0.4

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* [Qemu-devel] [RFC PATCH 2/2] ARM: Virt: ACPI: Add GIC ITS description in ACPI MADT table
  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
  2015-12-18 15:12 ` [Qemu-devel] [RFC PATCH 0/2] " Peter Maydell
  2 siblings, 0 replies; 4+ messages in thread
From: Shannon Zhao @ 2015-11-29  8:22 UTC (permalink / raw)
  To: qemu-arm, peter.maydell, p.fedin
  Cc: hangaohuai, zhaoshenglong, qemu-devel, peter.huangpeng

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

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [Qemu-devel] [RFC PATCH 0/2] Add GIC ITS description in ACPI MADT table
  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 ` [Qemu-devel] [RFC PATCH 2/2] ARM: Virt: ACPI: Add GIC ITS description in ACPI MADT table Shannon Zhao
@ 2015-12-18 15:12 ` Peter Maydell
  2 siblings, 0 replies; 4+ messages in thread
From: Peter Maydell @ 2015-12-18 15:12 UTC (permalink / raw)
  To: Shannon Zhao
  Cc: hangaohuai, qemu-arm, Pavel Fedin, QEMU Developers, Huangpeng (Peter)

On 29 November 2015 at 08:22, Shannon Zhao <zhaoshenglong@huawei.com> wrote:
> From: Shannon Zhao <shannon.zhao@linaro.org>
>
> These two patches add ITS description in ACPI MADT table. It bases on
> Pavel Fedin's ITS series[1].
>
> [1]https://www.mail-archive.com/qemu-devel@nongnu.org/msg337421.html
>
> Shannon Zhao (2):
>   ACPI: Add GIC Interrupt Translation Service Structure definition
>   ARM: Virt: ACPI: Add GIC ITS description in ACPI MADT table
>
>  hw/arm/virt-acpi-build.c    | 11 +++++++++++
>  include/hw/acpi/acpi-defs.h | 13 ++++++++++++-
>  2 files changed, 23 insertions(+), 1 deletion(-)

Just a note to say these patches look fine and I'm assuming you'll
resend them when we get the ITS support in.

thanks
-- PMM

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2015-12-18 15:12 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
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 ` [Qemu-devel] [RFC PATCH 2/2] ARM: Virt: ACPI: Add GIC ITS description in ACPI MADT table Shannon Zhao
2015-12-18 15:12 ` [Qemu-devel] [RFC PATCH 0/2] " 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.