From: Julien Grall <julien.grall@linaro.org>
To: vijay.kilari@gmail.com, Ian.Campbell@citrix.com,
stefano.stabellini@eu.citrix.com, stefano.stabellini@citrix.com,
xen-devel@lists.xen.org
Cc: Prasun.Kapoor@caviumnetworks.com, vijaya.kumar@caviumnetworks.com
Subject: Re: [PATCH v4 05/16] xen/arm: use ioremap to map gic-v2 registers
Date: Mon, 26 May 2014 14:10:48 +0100 [thread overview]
Message-ID: <53833D58.8060204@linaro.org> (raw)
In-Reply-To: <1401100009-7326-6-git-send-email-vijay.kilari@gmail.com>
Hi Vijay,
Thank you for the patch. Did you verify that GICv2 is correctly working
with theses changes?
On 26/05/14 11:26, vijay.kilari@gmail.com wrote:
> From: Vijaya Kumar K <Vijaya.Kumar@caviumnetworks.com>
>
> gic-v2 driver uses fixmap to map the registers.
> Instead use ioremap to access mmio registers.
>
> With this patch, gic-v2 register definitions are updated
> to use obsolute offset address instead of dividing the
> register offset by 4.
>
> Update vgic driver logic to compute using obsolute register
s/obsolute/obsolete/
> /* Local settings: interface controller */
> - GICC[GICC_PMR] = 0xff; /* Don't mask by priority */
> - GICC[GICC_BPR] = 0; /* Finest granularity of priority */
> - GICC[GICC_CTLR] = GICC_CTL_ENABLE|GICC_CTL_EOI; /* Turn on delivery */
> + writel_relaxed(0xff, GICC + GICC_PMR); /* Don't mask by priority */
> + writel_relaxed(0x0, GICC + GICC_BPR); /* Finest granularity of priority */
> + writel_relaxed(GICC_CTL_ENABLE|GICC_CTL_EOI, GICC + GICC_CTLR); /* Turn on delivery */
The coding style requests 80 characters per line.
> @@ -700,7 +713,7 @@ static void gic_update_one_lr(struct vcpu *v, int i)
> irq, v->domain->domain_id, v->vcpu_id, i);
> #endif
> } else {
> - GICH[GICH_LR + i] = 0;
> + writel_relaxed(0, GICH + GICH_LR + i * 4);
> clear_bit(i, &this_cpu(lr_mask));
>
> if ( p->desc != NULL )
> @@ -808,7 +821,7 @@ int gic_events_need_delivery(void)
> struct pending_irq *p;
> unsigned long flags;
>
> - mask_priority = (GICH[GICH_VMCR] >> GICH_VMCR_PRIORITY_SHIFT) & GICH_VMCR_PRIORITY_MASK;
> + mask_priority = (readl_relaxed(GICH + GICH_VMCR) >> GICH_VMCR_PRIORITY_SHIFT) & GICH_VMCR_PRIORITY_MASK;
Same remark here.
> /* Number of ranks of interrupt registers for a domain */
> #define DOMAIN_NR_RANKS(d) (((d)->arch.vgic.nr_lines+31)/32)
> @@ -55,7 +55,7 @@ static inline int REG_RANK_NR(int b, uint32_t n)
> * Offset of GICD_<FOO><n> with its rank, for GICD_<FOO> with
> * <b>-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_<FOO><n> register for
> @@ -63,7 +63,9 @@ 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;
> + n = n >> 2;
> + rank = REG_RANK_NR(b, n);
As n is only used for REG_RANK_NR, I would do:
int rank = REG_RANK_NR(b, n >> 2)
Otherwise than the few changes here, the patch looks good to me,
assuming you did some tests on GICv2.
Regards,
--
Julien Grall
next prev parent reply other threads:[~2014-05-26 13:10 UTC|newest]
Thread overview: 78+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-05-26 10:26 [PATCH v4 00/16] xen/arm: Add GICv3 support vijay.kilari
2014-05-26 10:26 ` [PATCH v4 01/16] xen/arm: move io.h as mmio.h to include folder vijay.kilari
2014-05-26 11:28 ` Julien Grall
2014-05-28 13:55 ` Stefano Stabellini
2014-05-26 10:26 ` [PATCH v4 02/16] xen/arm: make mmio handlers domain specific vijay.kilari
2014-05-26 12:33 ` Julien Grall
2014-05-28 14:05 ` Stefano Stabellini
2014-05-28 14:11 ` Julien Grall
2014-05-26 10:26 ` [PATCH v4 03/16] xen/arm: make sgi handling generic vijay.kilari
2014-05-26 12:41 ` Julien Grall
2014-05-26 12:45 ` Julien Grall
2014-05-28 14:10 ` Stefano Stabellini
2014-06-09 9:58 ` Vijay Kilari
2014-05-26 10:26 ` [PATCH v4 04/16] xen/arm: remove unused parameter in do_sgi call vijay.kilari
2014-05-26 12:48 ` Julien Grall
2014-05-26 10:26 ` [PATCH v4 05/16] xen/arm: use ioremap to map gic-v2 registers vijay.kilari
2014-05-26 13:10 ` Julien Grall [this message]
2014-05-30 12:54 ` Vijay Kilari
2014-05-28 14:26 ` Stefano Stabellini
2014-06-09 10:29 ` Vijay Kilari
2014-05-26 10:26 ` [PATCH v4 06/16] xen/arm: segregate and split GIC low level functionality vijay.kilari
2014-05-26 14:09 ` Julien Grall
2014-05-27 19:13 ` Julien Grall
2014-05-28 14:43 ` Stefano Stabellini
2014-05-26 10:26 ` [PATCH v4 07/16] arm/xen: move GIC context data structure to gic driver vijay.kilari
2014-05-26 14:32 ` Julien Grall
2014-05-28 14:49 ` Stefano Stabellini
2014-05-26 10:26 ` [PATCH v4 08/16] xen/arm: use device api to detect GIC version vijay.kilari
2014-05-26 14:39 ` Julien Grall
2014-05-28 14:52 ` Stefano Stabellini
2014-05-26 10:26 ` [PATCH v4 09/16] xen/arm: move vgic rank data to gic header file vijay.kilari
2014-05-27 11:32 ` Julien Grall
2014-05-28 14:54 ` Stefano Stabellini
2014-05-26 10:26 ` [PATCH v4 10/16] xen/arm: move vgic defines to vgic " vijay.kilari
2014-05-27 11:49 ` Julien Grall
2014-06-10 8:30 ` Vijay Kilari
2014-05-26 10:26 ` [PATCH v4 11/16] xen/arm: calculate vgic irq rank based on register size vijay.kilari
2014-05-27 11:56 ` Julien Grall
2014-05-30 8:59 ` Vijay Kilari
2014-05-30 9:58 ` Julien Grall
2014-05-30 10:24 ` Vijay Kilari
2014-05-30 10:36 ` Julien Grall
2014-05-30 10:51 ` Vijay Kilari
2014-05-30 10:54 ` Julien Grall
2014-05-26 10:26 ` [PATCH v4 12/16] xen/arm: split vgic driver into generic and vgic-v2 driver vijay.kilari
2014-05-27 16:50 ` Julien Grall
2014-05-26 10:26 ` [PATCH v4 13/16] xen/arm: Add support for GIC v3 vijay.kilari
2014-05-27 19:47 ` Julien Grall
2014-06-02 17:33 ` Stefano Stabellini
2014-06-03 8:54 ` Ian Campbell
2014-06-03 9:05 ` Julien Grall
2014-06-03 9:07 ` Ian Campbell
2014-06-03 10:43 ` Stefano Stabellini
2014-06-03 10:46 ` Stefano Stabellini
2014-05-26 10:26 ` [PATCH v4 14/16] xen/arm: Add virtual GICv3 support vijay.kilari
2014-06-02 15:50 ` Stefano Stabellini
2014-06-11 11:36 ` Vijay Kilari
2014-06-11 12:44 ` Stefano Stabellini
2014-06-02 16:10 ` Julien Grall
2014-06-02 16:15 ` Ian Campbell
2014-06-02 16:18 ` Julien Grall
2014-06-02 16:38 ` Ian Campbell
2014-06-02 16:46 ` Julien Grall
2014-05-26 10:26 ` [PATCH v4 15/16] xen/arm: Update Dom0 GIC dt node with GICv3 information vijay.kilari
2014-05-26 10:26 ` [PATCH v4 16/16] xen/arm: add SGI handling for GICv3 vijay.kilari
2014-06-02 16:05 ` Stefano Stabellini
2014-06-02 16:13 ` Ian Campbell
2014-06-11 12:34 ` Vijay Kilari
2014-06-02 16:17 ` Julien Grall
2014-06-11 12:35 ` Vijay Kilari
2014-06-11 12:38 ` Julien Grall
2014-06-12 6:53 ` Vijay Kilari
2014-06-12 21:56 ` Julien Grall
2014-06-13 8:34 ` Ian Campbell
2014-06-15 18:44 ` Julien Grall
2014-06-20 8:48 ` Vijay Kilari
2014-05-28 10:26 ` [PATCH v4 00/16] xen/arm: Add GICv3 support Ian Campbell
2014-05-28 12:34 ` 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=53833D58.8060204@linaro.org \
--to=julien.grall@linaro.org \
--cc=Ian.Campbell@citrix.com \
--cc=Prasun.Kapoor@caviumnetworks.com \
--cc=stefano.stabellini@citrix.com \
--cc=stefano.stabellini@eu.citrix.com \
--cc=vijay.kilari@gmail.com \
--cc=vijaya.kumar@caviumnetworks.com \
--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).