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, 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: [PATCH v7 5/5] xen/arm: check for GICv3 platform support
Date: Fri, 11 Jul 2014 18:21:32 +0530	[thread overview]
Message-ID: <1405083092-20216-6-git-send-email-vijay.kilari@gmail.com> (raw)
In-Reply-To: <1405083092-20216-1-git-send-email-vijay.kilari@gmail.com>

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

ID_AA64PFR0_EL1 register provides information about GIC support.
Check for this register in GICv3 driver.

Also print GICv3 support information in boot log

Signed-off-by: Vijaya Kumar K <Vijaya.Kumar@caviumnetworks.com>
---
v7: - return -ENODEV on lack GICv3 platform support instead of
      panic
---
 xen/arch/arm/gic-v3.c            |    7 +++++++
 xen/arch/arm/setup.c             |    5 +++--
 xen/include/asm-arm/cpufeature.h |    1 +
 xen/include/asm-arm/processor.h  |    5 ++---
 4 files changed, 13 insertions(+), 5 deletions(-)

diff --git a/xen/arch/arm/gic-v3.c b/xen/arch/arm/gic-v3.c
index 5ec5305..492fd54 100644
--- a/xen/arch/arm/gic-v3.c
+++ b/xen/arch/arm/gic-v3.c
@@ -38,6 +38,7 @@
 #include <asm/device.h>
 #include <asm/gic.h>
 #include <asm/gic_v3_defs.h>
+#include <asm/cpufeature.h>
 
 struct rdist_region {
     paddr_t base;
@@ -1135,6 +1136,12 @@ static int __init gicv3_init(struct dt_device_node *node, const void *data)
     int res, i;
     uint32_t reg;
 
+    if ( !cpu_has_gicv3 )
+    {
+        dprintk(XENLOG_ERR, "Platform does not support GICv3\n");
+        return -ENODEV;
+    }
+
     dt_device_set_used_by(node, DOMID_XEN);
 
     res = dt_device_get_address(node, 0, &gicv3.dbase, &gicv3.dbase_size);
diff --git a/xen/arch/arm/setup.c b/xen/arch/arm/setup.c
index 78dc7f5..6a90c81 100644
--- a/xen/arch/arm/setup.c
+++ b/xen/arch/arm/setup.c
@@ -100,9 +100,10 @@ static void __init processor_id(void)
            cpu_has_el2_32 ? "64+32" : cpu_has_el2_64 ? "64" : "No",
            cpu_has_el1_32 ? "64+32" : cpu_has_el1_64 ? "64" : "No",
            cpu_has_el0_32 ? "64+32" : cpu_has_el0_64 ? "64" : "No");
-    printk("    Extensions:%s%s\n",
+    printk("    Extensions:%s%s%s\n",
            cpu_has_fp ? " FloatingPoint" : "",
-           cpu_has_simd ? " AdvancedSIMD" : "");
+           cpu_has_simd ? " AdvancedSIMD" : "",
+           cpu_has_gicv3 ? " GICv3" : "");
 
     printk("  Debug Features: %016"PRIx64" %016"PRIx64"\n",
            boot_cpu_data.dbg64.bits[0], boot_cpu_data.dbg64.bits[1]);
diff --git a/xen/include/asm-arm/cpufeature.h b/xen/include/asm-arm/cpufeature.h
index 1d2c9c7..bd84c57 100644
--- a/xen/include/asm-arm/cpufeature.h
+++ b/xen/include/asm-arm/cpufeature.h
@@ -15,6 +15,7 @@
 #define cpu_has_el3_64    (boot_cpu_feature64(el3) >= 1)
 #define cpu_has_fp        (boot_cpu_feature64(fp) == 0)
 #define cpu_has_simd      (boot_cpu_feature64(simd) == 0)
+#define cpu_has_gicv3     (boot_cpu_feature64(gicv3) == 1)
 #endif
 
 #define cpu_feature32(c, feat)         ((c)->pfr32.feat)
diff --git a/xen/include/asm-arm/processor.h b/xen/include/asm-arm/processor.h
index ccaa9da..0188800 100644
--- a/xen/include/asm-arm/processor.h
+++ b/xen/include/asm-arm/processor.h
@@ -188,9 +188,8 @@ struct cpuinfo_arm {
             unsigned long el3:4;
             unsigned long fp:4;   /* Floating Point */
             unsigned long simd:4; /* Advanced SIMD */
-            unsigned long __res0:8;
-
-            unsigned long __res1;
+            unsigned long gicv3:4; /* GIC support */
+            unsigned long __res0:36;
         };
     } pfr64;
 
-- 
1.7.9.5

  parent reply	other threads:[~2014-07-11 12:51 UTC|newest]

Thread overview: 38+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-07-11 12:51 [PATCH v7 0/5] xen/arm: Add GICv3 support vijay.kilari
2014-07-11 12:51 ` [PATCH v7 1/5] xen/arm: Add support for GIC v3 vijay.kilari
2014-07-16 11:41   ` Ian Campbell
2014-07-22  9:48     ` Vijay Kilari
2014-07-22 10:01       ` Julien Grall
2014-07-22 10:43         ` Ian Campbell
2014-07-22 11:13           ` Julien Grall
2014-07-22 11:30             ` Vijay Kilari
2014-07-22 11:45               ` Ian Campbell
2014-07-22 10:39       ` Ian Campbell
2014-07-22 10:49         ` Vijay Kilari
2014-07-22 10:55           ` Ian Campbell
2014-07-22 11:12             ` Vijay Kilari
2014-07-22 11:15               ` Julien Grall
2014-07-22 11:19                 ` Ian Campbell
2014-07-11 12:51 ` [PATCH v7 2/5] xen/arm: Add virtual GICv3 support vijay.kilari
2014-07-14 15:59   ` Julien Grall
2014-07-16 11:47   ` Ian Campbell
2014-07-16 11:56     ` Vijay Kilari
2014-07-11 12:51 ` [PATCH v7 3/5] xen/arm: Update Dom0 GIC dt node with GICv3 information vijay.kilari
2014-07-16 11:53   ` Ian Campbell
2014-07-11 12:51 ` [PATCH v7 4/5] xen/arm: add SGI handling for GICv3 vijay.kilari
2014-07-11 13:43   ` Julien Grall
2014-07-11 14:08     ` Ian Campbell
2014-07-11 14:12       ` Julien Grall
2014-07-11 14:18         ` Ian Campbell
2014-07-22 13:48   ` Stefano Stabellini
2014-07-22 14:13     ` Vijay Kilari
2014-07-23  5:48       ` Vijay Kilari
2014-07-23 10:35         ` Stefano Stabellini
2014-07-11 12:51 ` vijay.kilari [this message]
2014-07-16 12:11   ` [PATCH v7 5/5] xen/arm: check for GICv3 platform support Ian Campbell
2014-07-16 10:35 ` [PATCH v7 0/5] xen/arm: Add GICv3 support Ian Campbell
2014-07-16 11:47   ` Vijay Kilari
2014-07-16 12:38     ` Ian Campbell
2014-07-16 13:32       ` Ian Campbell
2014-07-23 10:51         ` Vijay Kilari
2014-07-23 11:31           ` 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=1405083092-20216-6-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=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).