From: Ian Campbell Subject: Re: [PATCH v5 05/21] xen/arm: use ioremap to map gic-v2 registers Date: Tue, 17 Jun 2014 12:59:17 +0100 Message-ID: <1403006357.16844.72.camel@kazak.uk.xensource.com> References: <1402580192-13937-1-git-send-email-vijay.kilari@gmail.com> <1402580192-13937-6-git-send-email-vijay.kilari@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <1402580192-13937-6-git-send-email-vijay.kilari@gmail.com> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: vijay.kilari@gmail.com Cc: stefano.stabellini@eu.citrix.com, Prasun.Kapoor@caviumnetworks.com, Vijaya Kumar K , julien.grall@linaro.org, tim@xen.org, xen-devel@lists.xen.org, stefano.stabellini@citrix.com List-Id: xen-devel@lists.xenproject.org On Thu, 2014-06-12 at 19:06 +0530, vijay.kilari@gmail.com wrote: > static void gic_restore_pending_irqs(struct vcpu *v); > > /* Global state */ > static struct { > paddr_t dbase; /* Address of distributor registers */ > + void __iomem * map_dbase; /* IO mapped Address of distributor registers */ I wonder, do we still need the paddr_t ?base members after this change? > paddr_t cbase; /* Address of CPU interface registers */ > + void __iomem * map_cbase; /* IO mapped Address of CPU interface registers*/ > paddr_t hbase; /* Address of virtual interface registers */ > + void __iomem * map_hbase; /* IO Address of virtual interface registers */ > paddr_t vbase; /* Address of virtual cpu interface registers */ > unsigned int lines; /* Number of interrupts (SPIs + PPIs + SGIs) */ > unsigned int maintenance_irq; /* IRQ maintenance */ > @@ -139,8 +142,7 @@ static void gic_irq_enable(struct irq_desc *desc) > spin_lock_irqsave(&gic.lock, flags); > desc->status &= ~IRQ_DISABLED; > dsb(sy); > - /* Enable routing */ Please keep this comment. > @@ -58,7 +58,7 @@ static inline int REG_RANK_NR(int b, uint32_t n) > * Offset of GICD_ with its rank, for GICD_ with > * -bits-per-interrupt. > */ > -#define REG_RANK_INDEX(b, n) ((n) & ((b)-1)) > +#define REG_RANK_INDEX(b, n) (((n) >> 2) & ((b)-1)) > > /* > * Returns rank corresponding to a GICD_ register for > @@ -66,7 +66,7 @@ static inline int REG_RANK_NR(int b, uint32_t n) > */ > static struct vgic_irq_rank *vgic_irq_rank(struct vcpu *v, int b, int n) > { > - int rank = REG_RANK_NR(b, n); > + int rank = REG_RANK_NR(b, (n >> 2)); I think there must be better ways to do this than sprinkling >> 2 around the place (e.g. a helper macro), but OK for now. With the missing comment reinstated and the spelling error which Julien mentioned: Acked-by: Ian Campbell Ian.