All of lore.kernel.org
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH] ACPI: ARM: Present GIC version in MADT table
@ 2016-06-15  3:22 Shannon Zhao
  2016-06-15  8:52 ` Andrew Jones
  0 siblings, 1 reply; 3+ messages in thread
From: Shannon Zhao @ 2016-06-15  3:22 UTC (permalink / raw)
  To: qemu-arm, peter.maydell
  Cc: qemu-devel, imammedo, shannon.zhao, peter.huangpeng, zhaoshenglong

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

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 <shannon.zhao@linaro.org>
---
 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;
-- 
2.0.4

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

* Re: [Qemu-devel] [PATCH] ACPI: ARM: Present GIC version in MADT table
  2016-06-15  3:22 [Qemu-devel] [PATCH] ACPI: ARM: Present GIC version in MADT table Shannon Zhao
@ 2016-06-15  8:52 ` Andrew Jones
  2016-06-16 14:30   ` Peter Maydell
  0 siblings, 1 reply; 3+ messages in thread
From: Andrew Jones @ 2016-06-15  8:52 UTC (permalink / raw)
  To: Shannon Zhao
  Cc: qemu-arm, peter.maydell, imammedo, peter.huangpeng, qemu-devel,
	shannon.zhao

On Wed, Jun 15, 2016 at 11:22:35AM +0800, Shannon Zhao wrote:
> From: Shannon Zhao <shannon.zhao@linaro.org>
> 
> 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 <shannon.zhao@linaro.org>
> ---
>  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;
> -- 
> 2.0.4

AFAICT, Linux is actually fine with version=0 (as before this patch).
One way or another it has already determined that the gic is either v3
or v4, and then just proceeds. That said, it does seem like the right
thing to do to set it

Reviewed-by: Andrew Jones <drjones@redhat.com>

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

* Re: [Qemu-devel] [PATCH] ACPI: ARM: Present GIC version in MADT table
  2016-06-15  8:52 ` Andrew Jones
@ 2016-06-16 14:30   ` Peter Maydell
  0 siblings, 0 replies; 3+ messages in thread
From: Peter Maydell @ 2016-06-16 14:30 UTC (permalink / raw)
  To: Andrew Jones
  Cc: Shannon Zhao, qemu-arm, Igor Mammedov, Huangpeng (Peter),
	QEMU Developers, Shannon Zhao

On 15 June 2016 at 09:52, Andrew Jones <drjones@redhat.com> wrote:
> On Wed, Jun 15, 2016 at 11:22:35AM +0800, Shannon Zhao wrote:
>> From: Shannon Zhao <shannon.zhao@linaro.org>
>>
>> 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 <shannon.zhao@linaro.org>

>
> AFAICT, Linux is actually fine with version=0 (as before this patch).
> One way or another it has already determined that the gic is either v3
> or v4, and then just proceeds. That said, it does seem like the right
> thing to do to set it
>
> Reviewed-by: Andrew Jones <drjones@redhat.com>

Applied to target-arm.next, thanks.

-- PMM

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

end of thread, other threads:[~2016-06-16 14:30 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-06-15  3:22 [Qemu-devel] [PATCH] ACPI: ARM: Present GIC version in MADT table Shannon Zhao
2016-06-15  8:52 ` Andrew Jones
2016-06-16 14:30   ` 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.