xen-devel.lists.xenproject.org archive mirror
 help / color / mirror / Atom feed
From: Julien Grall <julien.grall@citrix.com>
To: xen-devel@lists.xenproject.org
Cc: Julien Grall <julien.grall@citrix.com>,
	ian.campbell@citrix.com, stefano.stabellini@eu.citrix.com
Subject: [PATCH v2 02/11] xen/arm: vgic-v3: Don't try to emulate IROUTER which doesn't exist in the spec
Date: Wed, 18 Nov 2015 17:27:57 +0000	[thread overview]
Message-ID: <1447867686-19371-3-git-send-email-julien.grall@citrix.com> (raw)
In-Reply-To: <1447867686-19371-1-git-send-email-julien.grall@citrix.com>

The range of valid IROUTER<n> are n = 32 - 1019 (see 8.9.13 in IHI 0069A)
which correspond to the offset 0x6100-0x7FD8.

Other offset are invalid and therefore should not be emulated.

Also remove the now unused label read_as_zero_64 and write_ignore_64.

Note that GICD_IROUTER is kept to accomadate the GICv3 drivers which has
been in part taken from Linux.

Signed-off-by: Julien Grall <julien.grall@citrix.com>
---

    Changes in v2:
        - This patch was supposed to be in v1, but messed up
        the git format-patch command
---
 xen/arch/arm/vgic-v3.c            | 19 ++-----------------
 xen/include/asm-arm/gic_v3_defs.h |  3 +--
 2 files changed, 3 insertions(+), 19 deletions(-)

diff --git a/xen/arch/arm/vgic-v3.c b/xen/arch/arm/vgic-v3.c
index 3a7b86f..902f64a 100644
--- a/xen/arch/arm/vgic-v3.c
+++ b/xen/arch/arm/vgic-v3.c
@@ -806,10 +806,7 @@ static int vgic_v3_distr_mmio_read(struct vcpu *v, mmio_info_t *info,
          * Manage in common
          */
         return __vgic_v3_distr_common_mmio_read("vGICD", v, info, gicd_reg, r);
-    case GICD_IROUTER ... GICD_IROUTER31:
-        /* SGI/PPI is RES0 */
-        goto read_as_zero_64;
-    case GICD_IROUTER32 ... GICD_IROUTERN:
+    case GICD_IROUTER32 ... GICD_IROUTER1019:
     {
         uint64_t irouter;
 
@@ -887,11 +884,6 @@ bad_width:
     domain_crash_synchronous();
     return 0;
 
-read_as_zero_64:
-    if ( vgic_reg64_check_access(dabt) ) goto bad_width;
-    *r = 0;
-    return 1;
-
 read_as_zero_32:
     if ( dabt.size != DABT_WORD ) goto bad_width;
     *r = 0;
@@ -974,10 +966,7 @@ static int vgic_v3_distr_mmio_write(struct vcpu *v, mmio_info_t *info,
          * Manage in common */
         return __vgic_v3_distr_common_mmio_write("vGICD", v, info,
                                                  gicd_reg, r);
-    case GICD_IROUTER ... GICD_IROUTER31:
-        /* SGI/PPI is RES0 */
-        goto write_ignore_64;
-    case GICD_IROUTER32 ... GICD_IROUTERN:
+    case GICD_IROUTER32 ... GICD_IROUTER1019:
     {
         uint64_t irouter;
 
@@ -1039,10 +1028,6 @@ write_ignore_32:
     if ( dabt.size != DABT_WORD ) goto bad_width;
     return 1;
 
-write_ignore_64:
-    if ( vgic_reg64_check_access(dabt) ) goto bad_width;
-    return 1;
-
 write_ignore:
     return 1;
 }
diff --git a/xen/include/asm-arm/gic_v3_defs.h b/xen/include/asm-arm/gic_v3_defs.h
index c6d73df..89a3548 100644
--- a/xen/include/asm-arm/gic_v3_defs.h
+++ b/xen/include/asm-arm/gic_v3_defs.h
@@ -29,9 +29,8 @@
 #define GICD_SETSPI_SR               (0x050)
 #define GICD_CLRSPI_SR               (0x058)
 #define GICD_IROUTER                 (0x6000)
-#define GICD_IROUTER31               (0x60F8)
 #define GICD_IROUTER32               (0x6100)
-#define GICD_IROUTERN                (0x7FF8)
+#define GICD_IROUTER1019             (0x7FD8)
 #define GICD_PIDR0                   (0xFFE0)
 #define GICD_PIDR1                   (0xFFE4)
 #define GICD_PIDR2                   (0xFFE8)
-- 
2.1.4

  parent reply	other threads:[~2015-11-18 17:29 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-11-18 17:27 [PATCH v2 00/11] xen/arm: Bunch of fixes for the vGIC emulation Julien Grall
2015-11-18 17:27 ` [PATCH v2 01/11] xen/arm: vgic-v2: Implement correctly ICFGR{0, 1} read-only Julien Grall
2015-11-24 17:14   ` Ian Campbell
2015-11-25 12:29     ` Ian Campbell
2015-11-30 12:11       ` Julien Grall
2015-11-18 17:27 ` Julien Grall [this message]
2015-11-24 17:17   ` [PATCH v2 02/11] xen/arm: vgic-v3: Don't try to emulate IROUTER which doesn't exist in the spec Ian Campbell
2015-11-30 12:13     ` Julien Grall
2015-11-18 17:27 ` [PATCH v2 03/11] xen/arm: vgic-v3: Use the correct offset GICR_IGRPMODR0 Julien Grall
2015-11-18 17:27 ` [PATCH v2 04/11] xen/arm: vgic-v3: Only emulate identification registers required by the spec Julien Grall
2015-11-18 17:28 ` [PATCH v2 05/11] xen/arm: vgic: Properly emulate the full register Julien Grall
2015-11-25  9:26   ` Shannon Zhao
2015-11-25 12:15     ` unhandled word causes Xen crash with recent Linux kernels, was: " Stefano Stabellini
2015-11-25 12:26       ` Ian Campbell
2015-11-30 12:22         ` Julien Grall
2015-11-30 12:38           ` Ian Campbell
2015-12-03 10:50             ` Stefano Stabellini
2015-11-30 12:18       ` Julien Grall
2015-11-18 17:28 ` [PATCH v2 06/11] xen/arm: vgic-v3: Remove GICR_MOVALLR and GICR_MOVLPIR Julien Grall
2015-11-18 17:28 ` [PATCH v2 07/11] xen/arm: vgic: Re-order the register emulations to match the memory map Julien Grall
2015-11-18 17:28 ` [PATCH v2 08/11] xen/arm: vgic-v3: Emulate read to GICD_ICACTIVER<n> Julien Grall
2015-11-18 17:28 ` [PATCH v2 09/11] xen/arm: vgic-v3: Remove spurious return in GICR_INVALLR Julien Grall
2015-11-18 17:28 ` [PATCH v2 10/11] xen/arm: vgic-v3: Don't implement write-only register read as zero Julien Grall
2015-11-18 17:28 ` [PATCH v2 11/11] xen/arm: vgic-v3: Make clear that GICD_*SPI_* registers are reserved Julien Grall

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=1447867686-19371-3-git-send-email-julien.grall@citrix.com \
    --to=julien.grall@citrix.com \
    --cc=ian.campbell@citrix.com \
    --cc=stefano.stabellini@eu.citrix.com \
    --cc=xen-devel@lists.xenproject.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).