xen-devel.lists.xenproject.org archive mirror
 help / color / mirror / Atom feed
* [RFC PATCH] xen/arm: GICv3 support for domU
@ 2014-08-20 10:09 vijay.kilari
  2014-09-12 22:09 ` Julien Grall
  0 siblings, 1 reply; 7+ messages in thread
From: vijay.kilari @ 2014-08-20 10:09 UTC (permalink / raw)
  To: Ian.Campbell, julien.grall, stefano.stabellini,
	stefano.stabellini, tim, jbeulich, xen-devel
  Cc: Prasun.Kapoor, Vijaya Kumar K, manish.jaggi, vijay.kilari

From: Vijaya Kumar K <Vijaya.Kumar@caviumnetworks.com>

Update libxl tool for arm64 to generate GICv3 device
tree node for domU.

This patch is only for verifying DomU boot on hardware
with GICv3 support and hardcodes GICv3 node information
for DomU. Clean implementation is required using
domctl

Signed-off-by: Vijaya Kumar K <Vijaya.Kumar@caviumnetworks.com>
---
 tools/libxl/libxl_arm.c       |   15 ++++++++++-----
 xen/arch/arm/gic-v3.c         |   11 ++++++++++-
 xen/include/public/arch-arm.h |    8 ++++++++
 3 files changed, 28 insertions(+), 6 deletions(-)

diff --git a/tools/libxl/libxl_arm.c b/tools/libxl/libxl_arm.c
index e19e2f4..c801c56 100644
--- a/tools/libxl/libxl_arm.c
+++ b/tools/libxl/libxl_arm.c
@@ -317,9 +317,8 @@ static int make_intc_node(libxl__gc *gc, void *fdt,
     res = fdt_begin_node(fdt, name);
     if (res) return res;
 
-    res = fdt_property_compat(gc, fdt, 2,
-                              "arm,cortex-a15-gic",
-                              "arm,cortex-a9-gic");
+    res = fdt_property_compat(gc, fdt, 1,
+                              "arm,gic-v3");
     if (res) return res;
 
 
@@ -332,6 +331,12 @@ static int make_intc_node(libxl__gc *gc, void *fdt,
     res = fdt_property(fdt, "interrupt-controller", NULL, 0);
     if (res) return res;
 
+    res = fdt_property_cell(fdt, "redistributor-stride", GUEST_GICV3_RDIST_STRIDE);
+    if (res) return res;
+
+    res = fdt_property_cell(fdt, "#redistributor-regions", GUEST_GICV3_RDIST_REGIONS);
+    if (res) return res;
+
     res = fdt_property_regs(gc, fdt, ROOT_ADDRESS_CELLS, ROOT_SIZE_CELLS,
                             2,
                             gicd_base, gicd_size,
@@ -521,8 +526,8 @@ next_resize:
 
         FDT( make_memory_nodes(gc, fdt, dom) );
         FDT( make_intc_node(gc, fdt,
-                            GUEST_GICD_BASE, GUEST_GICD_SIZE,
-                            GUEST_GICC_BASE, GUEST_GICD_SIZE) );
+                            GUEST_GICV3_GICD_BASE, GUEST_GICV3_GICD_SIZE,
+                            GUEST_GICV3_GICR_BASE, GUEST_GICV3_GICR_SIZE) );
 
         FDT( make_timer_node(gc, fdt, ainfo) );
         FDT( make_hypervisor_node(gc, fdt, vers) );
diff --git a/xen/arch/arm/gic-v3.c b/xen/arch/arm/gic-v3.c
index 9291a7a..d00561b 100644
--- a/xen/arch/arm/gic-v3.c
+++ b/xen/arch/arm/gic-v3.c
@@ -906,7 +906,16 @@ static int gicv_v3_init(struct domain *d)
         d->arch.vgic.rdist_count = gicv3.rdist_count;
     }
     else
-        d->arch.vgic.dbase = GUEST_GICD_BASE;
+    {
+        d->arch.vgic.dbase = GUEST_GICV3_GICD_BASE;
+        d->arch.vgic.dbase_size = GUEST_GICV3_GICD_SIZE;
+
+        d->arch.vgic.rbase[0] = GUEST_GICV3_GICR_BASE;
+        d->arch.vgic.rbase_size[0] = GUEST_GICV3_GICR_SIZE;
+        d->arch.vgic.rdist_stride = GUEST_GICV3_RDIST_STRIDE;
+        /* XXX: Only one Re-distributor region mapped for guest */
+        d->arch.vgic.rdist_count = GUEST_GICV3_RDIST_REGIONS;
+    }
 
     d->arch.vgic.nr_lines = 0;
 
diff --git a/xen/include/public/arch-arm.h b/xen/include/public/arch-arm.h
index ac54cd6..c7c12e0 100644
--- a/xen/include/public/arch-arm.h
+++ b/xen/include/public/arch-arm.h
@@ -369,6 +369,14 @@ typedef uint64_t xen_callback_t;
 #define GUEST_GICC_BASE   0x03002000ULL
 #define GUEST_GICC_SIZE   0x00000100ULL
 
+/* GICv3 address space */
+#define GUEST_GICV3_GICD_BASE     0x03001000ULL
+#define GUEST_GICV3_GICD_SIZE     0x10000ULL
+#define GUEST_GICV3_GICR_BASE     0x03020000ULL
+#define GUEST_GICV3_GICR_SIZE     0x200000ULL
+#define GUEST_GICV3_RDIST_STRIDE  0x20000ULL
+#define GUEST_GICV3_RDIST_REGIONS 0x1ULL
+
 /* 16MB == 4096 pages reserved for guest to use as a region to map its
  * grant table in.
  */
-- 
1.7.9.5

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

end of thread, other threads:[~2014-09-22 14:02 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-08-20 10:09 [RFC PATCH] xen/arm: GICv3 support for domU vijay.kilari
2014-09-12 22:09 ` Julien Grall
2014-09-15 15:13   ` Vijay Kilari
2014-09-22 11:53     ` Vijay Kilari
2014-09-22 12:44       ` Julien Grall
2014-09-22 13:15         ` Vijay Kilari
2014-09-22 14:02           ` Ian Campbell

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).