All of lore.kernel.org
 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>,
	vijay.kilari@gmail.com
Subject: [PATCH v5 15/21] xen/arm: Remove REG macro in vgic driver
Date: Thu, 12 Jun 2014 19:06:26 +0530	[thread overview]
Message-ID: <1402580192-13937-16-git-send-email-vijay.kilari@gmail.com> (raw)
In-Reply-To: <1402580192-13937-1-git-send-email-vijay.kilari@gmail.com>

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

REG macro does not compute any value and offset
variable is no more required. Hence removed

Signed-off-by: Vijaya Kumar K <Vijaya.Kumar@caviumnetworks.com>
---
 xen/arch/arm/vgic.c |   68 ++++++++++++++++++++++++---------------------------
 1 file changed, 32 insertions(+), 36 deletions(-)

diff --git a/xen/arch/arm/vgic.c b/xen/arch/arm/vgic.c
index 7be2b8f..a6b1894 100644
--- a/xen/arch/arm/vgic.c
+++ b/xen/arch/arm/vgic.c
@@ -31,8 +31,6 @@
 #include <asm/gic.h>
 #include <asm/vgic.h>
 
-#define REG(n) (n)
-
 static int vgic_distr_mmio_read(struct vcpu *v, mmio_info_t *info);
 static int vgic_distr_mmio_write(struct vcpu *v, mmio_info_t *info);
 
@@ -151,8 +149,7 @@ static int vgic_distr_mmio_read(struct vcpu *v, mmio_info_t *info)
     struct cpu_user_regs *regs = guest_cpu_user_regs();
     register_t *r = select_user_reg(regs, dabt.reg);
     struct vgic_irq_rank *rank;
-    int offset = (int)(info->gpa - v->domain->arch.vgic.dbase);
-    int gicd_reg = REG(offset);
+    int gicd_reg = (int)(info->gpa - v->domain->arch.vgic.dbase);
 
     switch ( gicd_reg )
     {
@@ -180,7 +177,7 @@ static int vgic_distr_mmio_read(struct vcpu *v, mmio_info_t *info)
         return 1;
 
     /* Implementation defined -- read as zero */
-    case REG(0x020) ... REG(0x03c):
+    case 0x020 ... 0x03c:
         goto read_as_zero;
 
     case GICD_IGROUPR ... GICD_IGROUPRN:
@@ -210,7 +207,7 @@ static int vgic_distr_mmio_read(struct vcpu *v, mmio_info_t *info)
         rank = vgic_irq_rank(v, 1, gicd_reg - GICD_ISPENDR, DABT_WORD);
         if ( rank == NULL) goto read_as_zero;
         vgic_lock_rank(v, rank);
-        *r = vgic_byte_read(rank->ipend, dabt.sign, offset);
+        *r = vgic_byte_read(rank->ipend, dabt.sign, gicd_reg);
         vgic_unlock_rank(v, rank);
         return 1;
 
@@ -219,7 +216,7 @@ static int vgic_distr_mmio_read(struct vcpu *v, mmio_info_t *info)
         rank = vgic_irq_rank(v, 1, gicd_reg - GICD_ICPENDR, DABT_WORD);
         if ( rank == NULL) goto read_as_zero;
         vgic_lock_rank(v, rank);
-        *r = vgic_byte_read(rank->ipend, dabt.sign, offset);
+        *r = vgic_byte_read(rank->ipend, dabt.sign, gicd_reg);
         vgic_unlock_rank(v, rank);
         return 1;
 
@@ -250,7 +247,7 @@ static int vgic_distr_mmio_read(struct vcpu *v, mmio_info_t *info)
         *r = rank->itargets[REG_RANK_INDEX(8, gicd_reg - GICD_ITARGETSR,
                                            DABT_WORD)];
         if ( dabt.size == DABT_BYTE )
-            *r = vgic_byte_read(*r, dabt.sign, offset);
+            *r = vgic_byte_read(*r, dabt.sign, gicd_reg);
         vgic_unlock_rank(v, rank);
         return 1;
 
@@ -263,7 +260,7 @@ static int vgic_distr_mmio_read(struct vcpu *v, mmio_info_t *info)
         *r = rank->ipriority[REG_RANK_INDEX(8, gicd_reg - GICD_IPRIORITYR,
                                             DABT_WORD)];
         if ( dabt.size == DABT_BYTE )
-            *r = vgic_byte_read(*r, dabt.sign, offset);
+            *r = vgic_byte_read(*r, dabt.sign, gicd_reg);
         vgic_unlock_rank(v, rank);
         return 1;
 
@@ -291,7 +288,7 @@ static int vgic_distr_mmio_read(struct vcpu *v, mmio_info_t *info)
         rank = vgic_irq_rank(v, 1, gicd_reg - GICD_CPENDSGIR, DABT_WORD);
         if ( rank == NULL) goto read_as_zero;
         vgic_lock_rank(v, rank);
-        *r = vgic_byte_read(rank->pendsgi, dabt.sign, offset);
+        *r = vgic_byte_read(rank->pendsgi, dabt.sign, gicd_reg);
         vgic_unlock_rank(v, rank);
         return 1;
 
@@ -300,12 +297,12 @@ static int vgic_distr_mmio_read(struct vcpu *v, mmio_info_t *info)
         rank = vgic_irq_rank(v, 1, gicd_reg - GICD_SPENDSGIR, DABT_WORD);
         if ( rank == NULL) goto read_as_zero;
         vgic_lock_rank(v, rank);
-        *r = vgic_byte_read(rank->pendsgi, dabt.sign, offset);
+        *r = vgic_byte_read(rank->pendsgi, dabt.sign, gicd_reg);
         vgic_unlock_rank(v, rank);
         return 1;
 
     /* Implementation defined -- read as zero */
-    case REG(0xfd0) ... REG(0xfe4):
+    case 0xfd0 ... 0xfe4:
         goto read_as_zero;
 
     case GICD_ICPIDR2:
@@ -314,27 +311,27 @@ static int vgic_distr_mmio_read(struct vcpu *v, mmio_info_t *info)
         return 0;
 
     /* Implementation defined -- read as zero */
-    case REG(0xfec) ... REG(0xffc):
+    case 0xfec ... 0xffc:
         goto read_as_zero;
 
     /* Reserved -- read as zero */
-    case REG(0x00c) ... REG(0x01c):
-    case REG(0x040) ... REG(0x07c):
-    case REG(0x7fc):
-    case REG(0xbfc):
-    case REG(0xf04) ... REG(0xf0c):
-    case REG(0xf30) ... REG(0xfcc):
+    case 0x00c ... 0x01c:
+    case 0x040 ... 0x07c:
+    case 0x7fc:
+    case 0xbfc:
+    case 0xf04 ... 0xf0c:
+    case 0xf30 ... 0xfcc:
         goto read_as_zero;
 
     default:
         printk("vGICD: unhandled read r%d offset %#08x\n",
-               dabt.reg, offset);
+               dabt.reg, gicd_reg);
         return 0;
     }
 
 bad_width:
     printk("vGICD: bad read width %d r%d offset %#08x\n",
-           dabt.size, dabt.reg, offset);
+           dabt.size, dabt.reg, gicd_reg);
     domain_crash_synchronous();
     return 0;
 
@@ -455,8 +452,7 @@ static int vgic_distr_mmio_write(struct vcpu *v, mmio_info_t *info)
     struct cpu_user_regs *regs = guest_cpu_user_regs();
     register_t *r = select_user_reg(regs, dabt.reg);
     struct vgic_irq_rank *rank;
-    int offset = (int)(info->gpa - v->domain->arch.vgic.dbase);
-    int gicd_reg = REG(offset);
+    int gicd_reg = (int)(info->gpa - v->domain->arch.vgic.dbase);
     uint32_t tr;
 
     switch ( gicd_reg )
@@ -473,7 +469,7 @@ static int vgic_distr_mmio_write(struct vcpu *v, mmio_info_t *info)
         goto write_ignore;
 
     /* Implementation defined -- write ignored */
-    case REG(0x020) ... REG(0x03c):
+    case 0x020 ... 0x03c:
         goto write_ignore;
 
     case GICD_IGROUPR ... GICD_IGROUPRN:
@@ -548,7 +544,7 @@ static int vgic_distr_mmio_write(struct vcpu *v, mmio_info_t *info)
                                           DABT_WORD)] = *r;
         else
             vgic_byte_write(&rank->itargets[REG_RANK_INDEX(8,
-                        gicd_reg - GICD_ITARGETSR, DABT_WORD)], *r, offset);
+                        gicd_reg - GICD_ITARGETSR, DABT_WORD)], *r, gicd_reg);
         vgic_unlock_rank(v, rank);
         return 1;
 
@@ -562,7 +558,7 @@ static int vgic_distr_mmio_write(struct vcpu *v, mmio_info_t *info)
                                            DABT_WORD)] = *r;
         else
             vgic_byte_write(&rank->ipriority[REG_RANK_INDEX(8,
-                       gicd_reg - GICD_IPRIORITYR, DABT_WORD)], *r, offset);
+                       gicd_reg - GICD_IPRIORITYR, DABT_WORD)], *r, gicd_reg);
         vgic_unlock_rank(v, rank);
         return 1;
 
@@ -602,7 +598,7 @@ static int vgic_distr_mmio_write(struct vcpu *v, mmio_info_t *info)
         return 0;
 
     /* Implementation defined -- write ignored */
-    case REG(0xfd0) ... REG(0xfe4):
+    case 0xfd0 ... 0xfe4:
         goto write_ignore;
 
     /* R/O -- write ignore */
@@ -610,27 +606,27 @@ static int vgic_distr_mmio_write(struct vcpu *v, mmio_info_t *info)
         goto write_ignore;
 
     /* Implementation defined -- write ignored */
-    case REG(0xfec) ... REG(0xffc):
+    case 0xfec ... 0xffc:
         goto write_ignore;
 
     /* Reserved -- write ignored */
-    case REG(0x00c) ... REG(0x01c):
-    case REG(0x040) ... REG(0x07c):
-    case REG(0x7fc):
-    case REG(0xbfc):
-    case REG(0xf04) ... REG(0xf0c):
-    case REG(0xf30) ... REG(0xfcc):
+    case 0x00c ... 0x01c:
+    case 0x040 ... 0x07c:
+    case 0x7fc:
+    case 0xbfc:
+    case 0xf04 ... 0xf0c:
+    case 0xf30 ... 0xfcc:
         goto write_ignore;
 
     default:
         printk("vGICD: unhandled write r%d=%"PRIregister" offset %#08x\n",
-               dabt.reg, *r, offset);
+               dabt.reg, *r, gicd_reg);
         return 0;
     }
 
 bad_width:
     printk("vGICD: bad write width %d r%d=%"PRIregister" offset %#08x\n",
-           dabt.size, dabt.reg, *r, offset);
+           dabt.size, dabt.reg, *r, gicd_reg);
     domain_crash_synchronous();
     return 0;
 
-- 
1.7.9.5

  parent reply	other threads:[~2014-06-12 13:36 UTC|newest]

Thread overview: 87+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-06-12 13:36 [PATCH v5 00/21] xen/arm: Add GICv3 support vijay.kilari
2014-06-12 13:36 ` [PATCH v5 01/21] xen/arm: move io.h as mmio.h to include folder vijay.kilari
2014-06-17 11:52   ` Ian Campbell
2014-06-12 13:36 ` [PATCH v5 02/21] xen/arm: make mmio handlers domain specific vijay.kilari
2014-06-12 16:07   ` Stefano Stabellini
2014-06-12 22:19   ` Julien Grall
2014-06-17 11:53   ` Ian Campbell
2014-06-12 13:36 ` [PATCH v5 03/21] xen/arm: make sgi handling generic vijay.kilari
2014-06-17 11:52   ` Ian Campbell
2014-06-12 13:36 ` [PATCH v5 04/21] xen/arm: remove unused parameter in do_sgi call vijay.kilari
2014-06-12 13:36 ` [PATCH v5 05/21] xen/arm: use ioremap to map gic-v2 registers vijay.kilari
2014-06-12 16:11   ` Stefano Stabellini
2014-06-15 16:02   ` Julien Grall
2014-06-17 11:59   ` Ian Campbell
2014-06-18 21:19   ` Julien Grall
2014-06-12 13:36 ` [PATCH v5 06/21] xen/arm: segregate and split GIC low level functionality vijay.kilari
2014-06-12 16:26   ` Stefano Stabellini
2014-06-12 22:46     ` Julien Grall
2014-06-12 22:44   ` Julien Grall
2014-06-13  8:30     ` Ian Campbell
2014-06-19  9:56     ` Vijay Kilari
2014-06-19 10:49       ` Julien Grall
2014-06-15 17:47   ` Julien Grall
2014-06-17 12:15   ` Ian Campbell
2014-06-12 13:36 ` [PATCH v5 07/21] arm/xen: move GIC context data structure to gic driver vijay.kilari
2014-06-12 16:28   ` Stefano Stabellini
2014-06-15 16:05   ` Julien Grall
2014-06-17 12:19   ` Ian Campbell
2014-06-12 13:36 ` [PATCH v5 08/21] xen/arm: use device api to detect GIC version vijay.kilari
2014-06-15 16:09   ` Julien Grall
2014-06-17 12:23   ` Ian Campbell
2014-06-12 13:36 ` [PATCH v5 09/21] xen/arm: move vgic rank data to gic header file vijay.kilari
2014-06-17 12:25   ` Ian Campbell
2014-06-12 13:36 ` [PATCH v5 10/21] xen/arm: move vgic defines to vgic " vijay.kilari
2014-06-17 12:27   ` Ian Campbell
2014-06-12 13:36 ` [PATCH v5 11/21] xen/arm: prefix byte_read and byte_write functions with vgic vijay.kilari
2014-06-15 16:23   ` Julien Grall
2014-06-15 16:34   ` Julien Grall
2014-06-17 12:28     ` Ian Campbell
2014-06-12 13:36 ` [PATCH v5 12/21] xen/arm: move is_vcpu_running function to sched.h vijay.kilari
2014-06-15 16:26   ` Julien Grall
2014-06-16  8:34     ` Jan Beulich
2014-06-19 10:58       ` Vijay Kilari
2014-06-19 11:03         ` Julien Grall
2014-06-19 11:11     ` Vijay Kilari
2014-06-12 13:36 ` [PATCH v5 13/21] xen/arm: move pending_irq structure to vgic header file vijay.kilari
2014-06-17 12:33   ` Ian Campbell
2014-06-12 13:36 ` [PATCH v5 14/21] xen/arm: calculate vgic irq rank based on register size vijay.kilari
2014-06-17 12:36   ` Ian Campbell
2014-06-12 13:36 ` vijay.kilari [this message]
2014-06-12 16:42   ` [PATCH v5 15/21] xen/arm: Remove REG macro in vgic driver Stefano Stabellini
2014-06-15 16:37   ` Julien Grall
2014-06-17 12:37   ` Ian Campbell
2014-06-12 13:36 ` [PATCH v5 16/21] xen/arm: split vgic driver into generic and vgic-v2 driver vijay.kilari
2014-06-15 17:04   ` Julien Grall
2014-06-17 13:19     ` Ian Campbell
2014-06-17 13:40       ` Julien Grall
2014-06-19 12:35     ` Vijay Kilari
2014-06-17 13:21   ` Ian Campbell
2014-06-18  3:33     ` Vijay Kilari
2014-06-18  9:17       ` Julien Grall
2014-06-12 13:36 ` [PATCH v5 17/21] xen/arm: Add support for GIC v3 vijay.kilari
2014-06-12 17:03   ` Stefano Stabellini
2014-06-12 22:58     ` Julien Grall
2014-06-15 18:10   ` Julien Grall
2014-06-12 13:36 ` [PATCH v5 18/21] xen/arm: Add virtual GICv3 support vijay.kilari
2014-06-12 17:09   ` Stefano Stabellini
2014-06-15 17:07     ` Julien Grall
2014-06-16 10:59       ` Stefano Stabellini
2014-06-16 11:08         ` Stefano Stabellini
2014-06-15 18:32   ` Julien Grall
2014-06-20  6:31     ` Vijay Kilari
2014-06-12 13:36 ` [PATCH v5 19/21] xen/arm: Update Dom0 GIC dt node with GICv3 information vijay.kilari
2014-06-15 18:36   ` Julien Grall
2014-06-12 13:36 ` [PATCH v5 20/21] xen/arm: add SGI handling for GICv3 vijay.kilari
2014-06-12 17:15   ` Stefano Stabellini
2014-06-12 17:23     ` Stefano Stabellini
2014-06-12 13:36 ` [PATCH v5 21/21] xen/arm: check for GICv3 platform support vijay.kilari
2014-06-12 22:51   ` Julien Grall
2014-06-16 15:28     ` Vijay Kilari
2014-06-16 15:37       ` Julien Grall
2014-06-16 15:43         ` Ian Campbell
2014-06-13 15:59 ` [PATCH v5 00/21] xen/arm: Add GICv3 support Stefano Stabellini
2014-06-13 16:15   ` Julien Grall
2014-06-17 15:39 ` Ian Campbell
2014-06-18  3:43   ` Vijay Kilari
2014-06-18 10:37     ` 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=1402580192-13937-16-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=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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.