xen-devel.lists.xenproject.org archive mirror
 help / color / mirror / Atom feed
From: vijay.kilari@gmail.com
To: Ian.Campbell@citrix.com, julien.grall@linaro.org,
	stefano.stabellini@eu.citrix.com, stefano.stabellini@citrix.com,
	tim@xen.org, jbeulich@suse.com, xen-devel@lists.xen.org
Cc: Prasun.Kapoor@caviumnetworks.com,
	Vijaya Kumar K <Vijaya.Kumar@caviumnetworks.com>,
	manish.jaggi@caviumnetworks.com, vijay.kilari@gmail.com
Subject: [RFC PATCH] xen/arm: GICv3 support for domU
Date: Wed, 20 Aug 2014 15:39:26 +0530	[thread overview]
Message-ID: <1408529366-21176-1-git-send-email-vijay.kilari@gmail.com> (raw)

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

             reply	other threads:[~2014-08-20 10:09 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-08-20 10:09 vijay.kilari [this message]
2014-09-12 22:09 ` [RFC PATCH] xen/arm: GICv3 support for domU 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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1408529366-21176-1-git-send-email-vijay.kilari@gmail.com \
    --to=vijay.kilari@gmail.com \
    --cc=Ian.Campbell@citrix.com \
    --cc=Prasun.Kapoor@caviumnetworks.com \
    --cc=Vijaya.Kumar@caviumnetworks.com \
    --cc=jbeulich@suse.com \
    --cc=julien.grall@linaro.org \
    --cc=manish.jaggi@caviumnetworks.com \
    --cc=stefano.stabellini@citrix.com \
    --cc=stefano.stabellini@eu.citrix.com \
    --cc=tim@xen.org \
    --cc=xen-devel@lists.xen.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).