xen-devel.lists.xenproject.org archive mirror
 help / color / mirror / Atom feed
From: Julien Grall <julien.grall@citrix.com>
To: vijay.kilari@gmail.com, Ian.Campbell@citrix.com,
	julien.grall@citrix.com, 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
Subject: Re: [RFC PATCH v3 04/18] xen/arm: gicv3: Refactor redistributor information
Date: Mon, 22 Jun 2015 16:00:35 +0100	[thread overview]
Message-ID: <55882313.3020407@citrix.com> (raw)
In-Reply-To: <1434974517-12136-5-git-send-email-vijay.kilari@gmail.com>

Hi,

On 22/06/15 13:01, vijay.kilari@gmail.com wrote:
> From: Vijaya Kumar K <Vijaya.Kumar@caviumnetworks.com>
> 
> Separate redistributor information into rdist and rdist_prop
> structures.
> 
> The rdist_prop holds the redistributor common information
> and rdist holds the per cpu specific information.
> 
> This percpu rdist defined as global and shared with ITS
> driver

This patch does more than refactoring, you are adding new fields which
are not use here.

Please explain why you need them or move them in the patch where they
are used. Comment on the usage of the field would be nice too.

FWIW, I would be in favor of the later.

> Signed-off-by: Vijaya Kumar K <Vijaya.Kumar@caviumnetworks.com>
> ---
>  xen/arch/arm/gic-v3.c             |   15 ++++++++++-----
>  xen/include/asm-arm/gic_v3_defs.h |   15 +++++++++++++++
>  2 files changed, 25 insertions(+), 5 deletions(-)
> 
> diff --git a/xen/arch/arm/gic-v3.c b/xen/arch/arm/gic-v3.c
> index 30682cf..b5c59f6 100644
> --- a/xen/arch/arm/gic-v3.c
> +++ b/xen/arch/arm/gic-v3.c
> @@ -53,6 +53,7 @@ static struct {
>      paddr_t dbase;            /* Address of distributor registers */
>      paddr_t dbase_size;
>      void __iomem *map_dbase;  /* Mapped address of distributor registers */
> +    struct rdist_prop rdist_data;
>      struct rdist_region *rdist_regions;
>      uint32_t  rdist_stride;
>      unsigned int rdist_count; /* Number of rdist regions count */
> @@ -63,10 +64,10 @@ static struct {
>  static struct gic_info gicv3_info;
>  
>  /* per-cpu re-distributor base */
> -static DEFINE_PER_CPU(void __iomem*, rbase);
> +DEFINE_PER_CPU(struct rdist, rdist);
>  
>  #define GICD                   (gicv3.map_dbase)
> -#define GICD_RDIST_BASE        (this_cpu(rbase))
> +#define GICD_RDIST_BASE        (per_cpu(rdist, smp_processor_id()).rbase)
>  #define GICD_RDIST_SGI_BASE    (GICD_RDIST_BASE + SZ_64K)
>  
>  /*
> @@ -613,6 +614,7 @@ static int __init gicv3_populate_rdist(void)
>      uint32_t aff;
>      uint32_t reg;
>      uint64_t typer;
> +    uint64_t offset;
>      uint64_t mpidr = cpu_logical_map(smp_processor_id());
>  
>      /*
> @@ -648,9 +650,12 @@ static int __init gicv3_populate_rdist(void)
>  
>              if ( (typer >> 32) == aff )
>              {
> -                this_cpu(rbase) = ptr;
> -                printk("GICv3: CPU%d: Found redistributor in region %d @%p\n",
> -                        smp_processor_id(), i, ptr);
> +                offset = ptr - gicv3.rdist_regions[i].map_base;
> +                per_cpu(rdist, smp_processor_id()).rbase = ptr;
> +                per_cpu(rdist, smp_processor_id()).phys_base =  gicv3.rdist_regions[i].base + offset;
> +                printk("GICv3: CPU%d: Found redistributor in region %d @%"PRIpaddr"\n",
> +                        smp_processor_id(), i,
> +                        per_cpu(rdist, smp_processor_id()).phys_base);
>                  return 0;
>              }
>              if ( gicv3.rdist_stride )
> diff --git a/xen/include/asm-arm/gic_v3_defs.h b/xen/include/asm-arm/gic_v3_defs.h
> index 556f114..acbb906 100644
> --- a/xen/include/asm-arm/gic_v3_defs.h
> +++ b/xen/include/asm-arm/gic_v3_defs.h
> @@ -152,6 +152,21 @@
>  #define ICH_SGI_IRQ_SHIFT            24
>  #define ICH_SGI_IRQ_MASK             0xf
>  #define ICH_SGI_TARGETLIST_MASK      0xffff
> +
> +struct rdist {
> +    void __iomem *rbase;
> +    void * pend_page;

void *pend_page;

> +    paddr_t phys_base;
> +};
> +
> +struct rdist_prop {

What does "prop" stand for?

> +    void * prop_page;

Ditto.

> +    int    id_bits;
> +    uint64_t flags;
> +};
> +
> +DECLARE_PER_CPU(struct rdist, rdist);
> +
>  #endif /* __ASM_ARM_GIC_V3_DEFS_H__ */
>  
>  /*
> 

Regards,


-- 
Julien Grall

  reply	other threads:[~2015-06-22 15:00 UTC|newest]

Thread overview: 88+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-06-22 12:01 [RFC PATCH v3 00/18] Add ITS support vijay.kilari
2015-06-22 12:01 ` [RFC PATCH v3 01/18] xen/arm: Add bitmap_find_next_zero_area helper function vijay.kilari
2015-06-22 14:14   ` Julien Grall
2015-06-22 12:01 ` [RFC PATCH v3 02/18] xen: Add log2 functionality vijay.kilari
2015-06-22 13:17   ` Jan Beulich
2015-06-24 13:05     ` Vijay Kilari
2015-06-24 13:21       ` Jan Beulich
2015-06-22 12:01 ` [RFC PATCH v3 03/18] xen: console: Add ratelimit support for error message vijay.kilari
2015-06-22 13:21   ` Jan Beulich
2015-06-25 13:14     ` Vijay Kilari
2015-06-25 13:21       ` Andrew Cooper
2015-06-25 13:31       ` Jan Beulich
2015-06-22 12:01 ` [RFC PATCH v3 04/18] xen/arm: gicv3: Refactor redistributor information vijay.kilari
2015-06-22 15:00   ` Julien Grall [this message]
2015-06-29 11:09   ` Ian Campbell
2015-06-22 12:01 ` [RFC PATCH v3 05/18] xen/arm: ITS: Port ITS driver to xen vijay.kilari
2015-06-22 17:16   ` Julien Grall
2015-06-26  9:19     ` Vijay Kilari
2015-06-26  9:52       ` Julien Grall
2015-06-29 11:39   ` Ian Campbell
2015-06-29 15:43     ` Vijay Kilari
2015-06-29 15:47       ` Vijay Kilari
2015-06-29 16:49         ` Ian Campbell
2015-06-22 12:01 ` [RFC PATCH v3 06/18] xen/arm: ITS: Add helper functions to manage its_devices vijay.kilari
2015-06-23 10:21   ` Julien Grall
2015-06-22 12:01 ` [RFC PATCH v3 07/18] xen/arm: ITS: implement hw_irq_controller for LPIs vijay.kilari
2015-06-23 14:32   ` Julien Grall
2015-06-26 12:54     ` Vijay Kilari
2015-06-26 15:05       ` Julien Grall
2015-06-29 11:53         ` Ian Campbell
2015-06-29 12:46           ` Julien Grall
2015-07-02 12:15         ` Vijay Kilari
2015-06-26 14:25     ` Vijay Kilari
2015-06-26 15:15       ` Julien Grall
2015-06-29 11:59     ` Ian Campbell
2015-07-02 12:21       ` Vijay Kilari
2015-07-02 12:35         ` Ian Campbell
2015-07-02 12:44           ` Vijay Kilari
2015-07-02 12:59             ` Ian Campbell
2015-07-02 16:11               ` Julien Grall
2015-06-22 12:01 ` [RFC PATCH v3 08/18] xen/arm: vITS: Add virtual ITS driver vijay.kilari
2015-06-23 16:39   ` Julien Grall
2015-07-02 13:33     ` Vijay Kilari
2015-07-02 14:30       ` Ian Campbell
2015-06-24  9:20   ` Julien Grall
2015-06-29 12:13   ` Ian Campbell
2015-06-22 12:01 ` [RFC PATCH v3 09/18] xen/arm: ITS: Add virtual ITS commands support vijay.kilari
2015-06-24 10:29   ` Julien Grall
2015-06-29 12:16     ` Ian Campbell
2015-06-29 12:18   ` Ian Campbell
2015-06-29 12:23   ` Ian Campbell
2015-07-03  6:50     ` Vijay Kilari
2015-07-03  8:41       ` Ian Campbell
2015-06-22 12:01 ` [RFC PATCH v3 10/18] xen/arm: ITS: Add APIs to add and assign device vijay.kilari
2015-06-24 11:38   ` Julien Grall
2015-06-29 12:25     ` Ian Campbell
2015-06-29 12:29   ` Ian Campbell
2015-07-02  8:40     ` Vijay Kilari
2015-07-02  9:01       ` Ian Campbell
2015-07-02 10:30         ` Julien Grall
2015-06-22 12:01 ` [RFC PATCH v3 11/18] xen/arm: ITS: Add GITS registers emulation vijay.kilari
2015-06-26 12:51   ` Julien Grall
2015-07-08 12:11   ` Ian Campbell
2015-06-22 12:01 ` [RFC PATCH v3 12/18] xen/arm: ITS: Add GICR register emulation vijay.kilari
2015-06-22 12:01 ` [RFC PATCH v3 13/18] xen/arm: ITS: Add irq descriptors for LPIs vijay.kilari
2015-06-29 12:58   ` Ian Campbell
2015-06-29 13:11     ` Julien Grall
2015-07-07 11:00       ` Vijay Kilari
2015-07-07 11:16         ` Julien Grall
2015-07-07 15:50           ` Ian Campbell
2015-07-07 15:52             ` Julien Grall
2015-07-07 16:04               ` Ian Campbell
2015-06-22 12:01 ` [RFC PATCH v3 14/18] xen/arm: ITS: Initialize physical ITS vijay.kilari
2015-06-22 12:01 ` [RFC PATCH v3 15/18] xen/arm: ITS: Add domain specific ITS initialization vijay.kilari
2015-06-29 13:01   ` Ian Campbell
2015-06-22 12:01 ` [RFC PATCH v3 16/18] xen/arm: ITS: Handle LPI interrupts vijay.kilari
2015-06-29 13:03   ` Ian Campbell
2015-06-22 12:01 ` [RFC PATCH v3 17/18] xen/arm: ITS: Generate ITS node for Dom0 vijay.kilari
2015-06-29 13:06   ` Ian Campbell
2015-07-07  5:31     ` Vijay Kilari
2015-07-07  8:21       ` Julien Grall
2015-07-07 10:25         ` Vijay Kilari
2015-07-07 11:07           ` Julien Grall
2015-06-22 12:01 ` [RFC PATCH v3 18/18] xen/arm: ITS: Map ITS translation space vijay.kilari
2015-06-22 13:52 ` [RFC PATCH v3 00/18] Add ITS support Julien Grall
2015-06-22 13:56   ` Ian Campbell
2015-06-24 10:02 ` Ian Campbell
2015-06-29 13:11 ` 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=55882313.3020407@citrix.com \
    --to=julien.grall@citrix.com \
    --cc=Ian.Campbell@citrix.com \
    --cc=Prasun.Kapoor@caviumnetworks.com \
    --cc=Vijaya.Kumar@caviumnetworks.com \
    --cc=manish.jaggi@caviumnetworks.com \
    --cc=stefano.stabellini@citrix.com \
    --cc=stefano.stabellini@eu.citrix.com \
    --cc=tim@xen.org \
    --cc=vijay.kilari@gmail.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).