Skip to contentSkip to conversation

xen/arm: gicv2: Export GICv2m register frames to Dom0 by device tree

PATCH In review Wei Chen 3 participants 4 messages Apr 27, 2016 – May 5, 2016

lore
Share & tools
lore

Wei Chen

author
#0 lore raw

PATCH v3 1/1 xen/arm: gicv2: Export GICv2m register frames to Dom0 by device tree

This patch adds v2m extension support in GIC-v2 driver. The GICv2 driver detects the MSI frames from device tree and creates corresponding device tree nodes in dom0's DTB. It also provides one hw_ops callback to map v2m MMIO regions to dom0 and route v2m SPIs to dom0.

With this GICv2m extension support, the dom0 kernel can do GICv2m frame setup and initialization.

This patch is based on the GICv2m patch of Suravee Suthikulpanit:
[PATCH 2/2] xen/arm: gicv2: Adding support for GICv2m in Dom0
http://lists.xen.org/archives/html/xen-devel/2015-04/msg02613.html

---
v3: Address comments from Julien
1. Add missed non-DT code to the separate function.
2. Fix some typos
3. Fix indentation issues.

v2: Address comments from Julien
1. Pull non-DT code in a separate function.
2. Fix one variable type error.
3. Fix indentation issues.
4. Revise some code comments.

 xen/arch/arm/domain_build.c |   5 +
 xen/arch/arm/gic-v2.c       | 298 ++++++++++++++++++++++++++++++++++++++++++++
 xen/arch/arm/gic.c          |   9 ++
 xen/include/asm-arm/gic.h   |   3 +
 4 files changed, 315 insertions(+)
xen/arch/arm/domain_build.c +5 -0
index 00dc07a..2e4c295 100644
@@ -2177,6 +2177,11 @@ int construct_dom0(struct domain *d)
     if ( rc < 0 )
         return rc;
 
+    /* Map extra GIC MMIO, irqs and other hw stuffs to dom0. */
+    rc = gic_map_hwdom_extra_mappings(d);
+    if ( rc < 0 )
+        return rc;
+
     rc = platform_specific_mapping(d);
     if ( rc < 0 )
         return rc;
xen/arch/arm/gic-v2.c +298 -0

340 lines not on this page · raw message

xen/arch/arm/gic.c +9 -0
index 2bfe4de..12bb0ab 100644
@@ -230,6 +230,15 @@ int gic_irq_xlate(const u32 *intspec, unsigned int intsize,
     return 0;
 }
 
+/* Map extra GIC MMIO, irqs and other hw stuffs to the hardware domain. */
+int gic_map_hwdom_extra_mappings(struct domain *d)
+{
+    if ( gic_hw_ops->map_hwdom_extra_mappings )
+        return gic_hw_ops->map_hwdom_extra_mappings(d);
+
+    return 0;
+}
+
 static void __init gic_dt_preinit(void)
 {
     int rc;
xen/include/asm-arm/gic.h +3 -0
index cd97bb2..836f1ad 100644
@@ -360,6 +360,8 @@ struct gic_hw_operations {
                               const struct dt_device_node *gic, void *fdt);
     /* Create MADT table for the hardware domain */
     int (*make_hwdom_madt)(const struct domain *d, u32 offset);
+    /* Map extra GIC MMIO, irqs and other hw stuffs to the hardware domain. */
+    int (*map_hwdom_extra_mappings)(struct domain *d);
     /* Deny access to GIC regions */
     int (*iomem_deny_access)(const struct domain *d);
 };
@@ -369,6 +371,7 @@ int gic_make_hwdom_dt_node(const struct domain *d,
                            const struct dt_device_node *gic,
                            void *fdt);
 int gic_make_hwdom_madt(const struct domain *d, u32 offset);
+int gic_map_hwdom_extra_mappings(struct domain *d);
 int gic_iomem_deny_access(const struct domain *d);
 
 #endif /* __ASSEMBLY__ */
Signature · 7 lines
2.5.0


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

Hi Wei,

Quoted 5 lines · Wei Chen

This patch adds v2m extension support in GIC-v2 driver. The GICv2 driver detects the MSI frames from device tree and creates corresponding device tree nodes in dom0's DTB. It also provides one hw_ops callback to map v2m MMIO regions to dom0 and route v2m SPIs to dom0.

Quoted 8 lines

With this GICv2m extension support, the dom0 kernel can do GICv2m frame setup and initialization.

This patch is based on the GICv2m patch of Suravee Suthikulpanit:
[PATCH 2/2] xen/arm: gicv2: Adding support for GICv2m in Dom0
http://lists.xen.org/archives/html/xen-devel/2015-04/msg02613.html

I have tested the patch and can get MSI working on Juno r2.

The tree is currently frozen in preparation for Xen 4.7. Nonetheless, with the comment mentioned in [1], this patch looks good to me:

Stefano, do you plan to carry patch for Xen 4.8? If not, I can create a separate branch and will resend the patch when the tree is re-opened.

Cheers,

[1] http://lists.xenproject.org/archives/html/xen-devel/2016-04/msg03540.html

Signature · 6 lines
Julien Grall

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

Hi Wei,

Quoted 5 lines · Wei Chen

This patch adds v2m extension support in GIC-v2 driver. The GICv2 driver detects the MSI frames from device tree and creates corresponding device tree nodes in dom0's DTB. It also provides one hw_ops callback to map v2m MMIO regions to dom0 and route v2m SPIs to dom0.

Quoted 8 lines

With this GICv2m extension support, the dom0 kernel can do GICv2m frame setup and initialization.

This patch is based on the GICv2m patch of Suravee Suthikulpanit:
[PATCH 2/2] xen/arm: gicv2: Adding support for GICv2m in Dom0
http://lists.xen.org/archives/html/xen-devel/2015-04/msg02613.html

I have tested the patch and can get MSI working on Juno r2.

Quoted 7 lines

The tree is currently frozen in preparation for Xen 4.7. Nonetheless, with the comment mentioned in [1], this patch looks good to me:

Stefano, do you plan to carry patch for Xen 4.8? If not, I can create a separate branch and will resend the patch when the tree is re-opened.

I have always been in favor of creating a branch, in fact I already do that for QEMU. So I create next-4.8 in
git://xenbits.xen.org/people/sstabellini/xen-unstable.git with this patch. (If I misunderstood your comment about the readiness of it, let me know. I'll force push the proper version.)

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

#3 lore raw
Quoted 23 lines · Stefano Stabellini
Quoted 22 lines · Julien Grall

Hi Wei,

Quoted 5 lines · Wei Chen

This patch adds v2m extension support in GIC-v2 driver. The GICv2 driver detects the MSI frames from device tree and creates corresponding device tree nodes in dom0's DTB. It also provides one hw_ops callback to map v2m MMIO regions to dom0 and route v2m SPIs to dom0.

Quoted 8 lines

With this GICv2m extension support, the dom0 kernel can do GICv2m frame setup and initialization.

This patch is based on the GICv2m patch of Suravee Suthikulpanit:
[PATCH 2/2] xen/arm: gicv2: Adding support for GICv2m in Dom0
http://lists.xen.org/archives/html/xen-devel/2015-04/msg02613.html

I have tested the patch and can get MSI working on Juno r2.

The tree is currently frozen in preparation for Xen 4.7. Nonetheless, with the comment mentioned in [1], this patch looks good to me:

Quoted 7 lines
Quoted 4 lines

Stefano, do you plan to carry patch for Xen 4.8? If not, I can create a separate branch and will resend the patch when the tree is re-opened.

I have always been in favor of creating a branch, in fact I already do that for QEMU. So I create next-4.8 in

Thank you!

Quoted 3 lines

git://xenbits.xen.org/people/sstabellini/xen-unstable.git with this patch. (If I misunderstood your comment about the readiness of it, let me know. I'll force push the proper version.)

I am fine with the patch pushed.

Cheers,

Signature · 6 lines
Julien Grall

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