Skip to contentSkip to conversation

arm/gic-v3: Fix ACPI probe fail on GICv4 hardware

PATCH Superseded Shanker Donthineni 2 participants 4 messages May 27, 2016

v2 of 3 Superseded Latest is v3 →

lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 arm/gic-v3: Fix ACPI probe fail on GICv4 hardware

The current driver ACPI probe fails on hardware which has GICv4 version, even though it is fully compatible to GICv3. This patch fixes the issue by registering the same probe function for GICv4 hardware.

---
Changes since v1:
- Edit commit text.
- Fix BUG() in xen/arch/arm/domain.c

This patch tested on Qualcomm Technologies on QDF2XXX platforms.

 xen/arch/arm/domain.c     |  5 +++++
 xen/arch/arm/gic-v3.c     | 13 +++++++++++++
 xen/include/asm-arm/gic.h |  1 +
 3 files changed, 19 insertions(+)
xen/arch/arm/domain.c +5 -0
index 1365b4a..5647b80 100644
@@ -571,6 +571,11 @@ int arch_domain_create(struct domain *d, unsigned int domcr_flags,
             d->arch.vgic.version = GIC_V3;
             break;
 
+	case GIC_V4:
+            config->gic_version = XEN_DOMCTL_CONFIG_GIC_V3;
+            d->arch.vgic.version = GIC_V3;
+            break;
+
         default:
             BUG();
         }
xen/arch/arm/gic-v3.c +13 -0
index a095064..594cf6e 100644
@@ -1604,10 +1604,23 @@ static int __init gicv3_acpi_preinit(const void *data)
     return 0;
 }
 
+static int __init gicv4_acpi_preinit(const void *data)
+{
+    gicv3_info.hw_version = GIC_V4;
+    register_gic_ops(&gicv3_ops);
+
+    return 0;
+}
+
 ACPI_DEVICE_START(agicv3, "GICv3", DEVICE_GIC)
         .class_type = ACPI_MADT_GIC_VERSION_V3,
         .init = gicv3_acpi_preinit,
 ACPI_DEVICE_END
+
+ACPI_DEVICE_START(agicv4, "GICv4", DEVICE_GIC)
+        .class_type = ACPI_MADT_GIC_VERSION_V4,
+        .init = gicv4_acpi_preinit,
+ACPI_DEVICE_END
 #endif
 
 /*
xen/include/asm-arm/gic.h +1 -0
index cd97bb2..5be814a 100644
@@ -218,6 +218,7 @@ struct gic_lr {
 enum gic_version {
     GIC_V2,
     GIC_V3,
+    GIC_V4,
 };
 
 extern enum gic_version gic_hw_version(void);
Signature · 9 lines
Qualcomm Technologies, Inc. on behalf of Qualcomm Innovation Center, Inc. 
Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum, 
a Linux Foundation Collaborative Project


_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xen.org/xen-devel
#1 lore raw

Hello Shanker,

Quoted 10 lines · Shanker Donthineni

The current driver ACPI probe fails on hardware which has GICv4 version, even though it is fully compatible to GICv3. This patch fixes the issue by registering the same probe function for GICv4 hardware.

---
Changes since v1:
- Edit commit text.
- Fix BUG() in xen/arch/arm/domain.c

Please see my latest comment on the previous version [1].

To go further, the ACPI tables may not represent the actual hardware. It is possible to have ACPI tables describing a GICv2 whilst the real hardware is a GICv3.

Xen will use the GICv2 driver and not the GICv3. So the helper will return GIC_V2 (and not GIC_V3).

Regards,

[1] https://www.mail-archive.com/[email protected]/msg69273.html

Signature · 6 lines
Julien Grall

_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xen.org/xen-devel
#2 lore raw
Quoted 14 lines · Julien Grall

Hello Shanker,

Quoted 10 lines · Shanker Donthineni

The current driver ACPI probe fails on hardware which has GICv4 version, even though it is fully compatible to GICv3. This patch fixes the issue by registering the same probe function for GICv4 hardware.

---
Changes since v1:
- Edit commit text.
- Fix BUG() in xen/arch/arm/domain.c

Quoted 4 lines

Please see my latest comment on the previous version [1].

To go further, the ACPI tables may not represent the actual hardware. It is possible to have ACPI tables describing a GICv2 whilst the real hardware is a GICv3.

Yes, it is absolutely valid and UEFI firmware can decide what to be exported to OS by changing the version number in ACPI MADT table.

On Qualcomm Technologies QDF2XXX platforms, GIC version set to 4.

Quoted 2 lines

Xen will use the GICv2 driver and not the GICv3. So the helper will return GIC_V2 (and not GIC_V3).

The current xen is supporting both the GICv2 and GICv3 for ACPI based boot.

ACPI_DEVICE_START(agicv3, "GICv3", DEVICE_GIC)
.class_type = ACPI_MADT_GIC_VERSION_V3,
.init = gicv3_acpi_preinit,
ACPI_DEVICE_END

ACPI_DEVICE_START(agicv2, "GICv2", DEVICE_GIC)
.class_type = ACPI_MADT_GIC_VERSION_V2,
.init = gicv2_acpi_preinit,
ACPI_DEVICE_END

Quoted 4 lines

Regards,

[1] https://www.mail-archive.com/[email protected]/msg69273.html

Signature · 9 lines
Shanker Donthineni
Qualcomm Technologies, Inc. on behalf of Qualcomm Innovation Center, Inc.
Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum, a Linux Foundation Collaborative Project


_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xen.org/xen-devel
#3 lore raw

Hello Shanker,

Quoted 13 lines · Shanker Donthineni
Quoted 12 lines · Julien Grall
Quoted 10 lines · Shanker Donthineni

The current driver ACPI probe fails on hardware which has GICv4 version, even though it is fully compatible to GICv3. This patch fixes the issue by registering the same probe function for GICv4 hardware.

---
Changes since v1:
- Edit commit text.
- Fix BUG() in xen/arch/arm/domain.c

Quoted 7 lines
Quoted 4 lines

Please see my latest comment on the previous version [1].

To go further, the ACPI tables may not represent the actual hardware. It is possible to have ACPI tables describing a GICv2 whilst the real hardware is a GICv3.

Yes, it is absolutely valid and UEFI firmware can decide what to be exported to OS by changing the version number in ACPI MADT table.

On Qualcomm Technologies QDF2XXX platforms, GIC version set to 4.

To be clear, I am not against adding support of GICv4 in Xen. My concern is how the patch add it. Exposing GICv4 beyond the GICv3 driver is not necessary today.

Better to keep as small as possible until we figure out how Xen will support GICv4 features.

I.e, the following the code should be enough.

ACPI_DEVICE_START(acgicv4, "GICv4", DEVICE_GIC)
.class_type = ACPI_MADT_GIC_VERSION_V4,
.init = gicv3_acpi_preinit,
ACPI_DEVICE_END

Quoted 11 lines
Quoted 3 lines

Xen will use the GICv2 driver and not the GICv3. So the helper will return GIC_V2 (and not GIC_V3).

The current xen is supporting both the GICv2 and GICv3 for ACPI based boot.

ACPI_DEVICE_START(agicv3, "GICv3", DEVICE_GIC)
.class_type = ACPI_MADT_GIC_VERSION_V3,
.init = gicv3_acpi_preinit,
ACPI_DEVICE_END

Quoted 4 lines

ACPI_DEVICE_START(agicv2, "GICv2", DEVICE_GIC)
.class_type = ACPI_MADT_GIC_VERSION_V2,
.init = gicv2_acpi_preinit,
ACPI_DEVICE_END

Regards,

Signature · 6 lines
Julien Grall

_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xen.org/xen-devel