xen-devel.lists.xenproject.org archive mirror
 help / color / mirror / Atom feed
From: Julien Grall <julien.grall@arm.com>
To: mjaggi@caviumnetworks.com, xen-devel@lists.xenproject.org
Cc: Andre.Przywara@arm.com, sstabellini@kernel.org,
	Manish Jaggi <mjaggi@cavium.com>
Subject: Re: [PATCH v3 2/5] ARM: ITS: Populate host_its_list from ACPI MADT Table
Date: Thu, 14 Sep 2017 12:09:52 +0100	[thread overview]
Message-ID: <7809520d-7e06-6df7-959f-db2e9a07d2d8@arm.com> (raw)
In-Reply-To: <1504631700-19358-3-git-send-email-mjaggi@caviumnetworks.com>

Hi Manish,

On 05/09/17 18:14, mjaggi@caviumnetworks.com wrote:
> From: Manish Jaggi <mjaggi@cavium.com>
> 
> Added gicv3_its_acpi_init to update host_its_list from MADT table.
> For ACPI, host_its structure  stores dt_node as NULL.
> 
> Signed-off-by: Manish Jaggi <mjaggi@cavium.com>
> ---
>   xen/arch/arm/gic-v3-its.c        | 26 ++++++++++++++++++++++++++
>   xen/arch/arm/gic-v3.c            |  2 ++
>   xen/include/asm-arm/gic_v3_its.h |  9 +++++++++
>   3 files changed, 37 insertions(+)
> 
> diff --git a/xen/arch/arm/gic-v3-its.c b/xen/arch/arm/gic-v3-its.c
> index 61a6452..536b48d 100644
> --- a/xen/arch/arm/gic-v3-its.c
> +++ b/xen/arch/arm/gic-v3-its.c
> @@ -25,6 +25,7 @@
>   #include <xen/rbtree.h>
>   #include <xen/sched.h>
>   #include <xen/sizes.h>
> +#include <xen/acpi.h>

Headers are ordered alphabetically, so please move this to the right place.

>   #include <asm/gic.h>
>   #include <asm/gic_v3_defs.h>
>   #include <asm/gic_v3_its.h>
> @@ -32,6 +33,7 @@
>   #include <asm/page.h>
>   
>   #define ITS_CMD_QUEUE_SZ                SZ_1M
> +#define ACPI_GICV3_ITS_MEM_SIZE         SZ_64K
>   
>   /*
>    * No lock here, as this list gets only populated upon boot while scanning
> @@ -1018,6 +1020,30 @@ void gicv3_its_dt_init(const struct dt_device_node *node)
>       }
>   }
>   
> +#ifdef CONFIG_ACPI
> +int gicv3_its_acpi_probe(struct acpi_subtable_header *header,

This should be static int...

> +                        const unsigned long end)
> +{
> +    struct acpi_madt_generic_translator *its;
> +
> +    its = (struct acpi_madt_generic_translator *)header;
> +    if ( BAD_MADT_ENTRY(its, end) )
> +        return -EINVAL;
> +
> +    add_to_host_its_list(its->base_address,
> +                        ACPI_GICV3_ITS_MEM_SIZE, NULL);
> +
> +    return 0;
> +}
> +
> +void gicv3_its_acpi_init(void)
> +{
> +    /* Parse ITS information */
> +    acpi_table_parse_madt(ACPI_MADT_TYPE_GENERIC_TRANSLATOR,
> +                                  gicv3_its_acpi_probe, 0);
> +}
> +#endif
> +
>   /*
>    * Local variables:
>    * mode: C
> diff --git a/xen/arch/arm/gic-v3.c b/xen/arch/arm/gic-v3.c
> index f990eae..6f562f4 100644
> --- a/xen/arch/arm/gic-v3.c
> +++ b/xen/arch/arm/gic-v3.c
> @@ -1567,6 +1567,8 @@ static void __init gicv3_acpi_init(void)
>   
>       gicv3.rdist_stride = 0;
>   
> +    gicv3_its_acpi_init();
> +
>       /*
>        * In ACPI, 0 is considered as the invalid address. However the rest
>        * of the initialization rely on the invalid address to be
> diff --git a/xen/include/asm-arm/gic_v3_its.h b/xen/include/asm-arm/gic_v3_its.h
> index 1fac1c7..993819a 100644
> --- a/xen/include/asm-arm/gic_v3_its.h
> +++ b/xen/include/asm-arm/gic_v3_its.h
> @@ -135,6 +135,9 @@ extern struct list_head host_its_list;
>   /* Parse the host DT and pick up all host ITSes. */
>   void gicv3_its_dt_init(const struct dt_device_node *node);
>   
> +#ifdef CONFIG_ACPI
> +void gicv3_its_acpi_init(void);
> +#endif
>   bool gicv3_its_host_has_its(void);
>   
>   unsigned int vgic_v3_its_count(const struct domain *d);
> @@ -196,6 +199,12 @@ static inline void gicv3_its_dt_init(const struct dt_device_node *node)
>   {
>   }
>   
> +#ifdef CONFIG_ACPI
> +static inline void gicv3_its_acpi_init(void)
> +{
> +}
> +#endif
> +
>   static inline bool gicv3_its_host_has_its(void)
>   {
>       return false;
> 

Cheers,

-- 
Julien Grall

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
https://lists.xen.org/xen-devel

  parent reply	other threads:[~2017-09-14 11:09 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-09-05 17:14 [PATCH v3 0/5] ARM: ACPI: ITS: Add ITS Support for ACPI hardware domain mjaggi
2017-09-05 17:14 ` [PATCH v3 1/5] ARM: ITS: Introduce common function add_to_host_its_list mjaggi
2017-09-07 16:56   ` Andre Przywara
2017-09-14 10:55   ` Julien Grall
2017-09-05 17:14 ` [PATCH v3 2/5] ARM: ITS: Populate host_its_list from ACPI MADT Table mjaggi
2017-09-07 16:56   ` Andre Przywara
2017-09-14 11:05     ` Julien Grall
2017-09-14 11:09   ` Julien Grall [this message]
2017-09-05 17:14 ` [PATCH v3 3/5] ARM: ITS: Deny hardware domain access to ITS mjaggi
2017-09-07 16:57   ` Andre Przywara
2017-09-14 11:16     ` Julien Grall
2017-09-20  6:53     ` Manish Jaggi
2017-09-05 17:14 ` [PATCH v3 4/5] ARM: Introduce get_hwdom_madt_size in gic_hw_operations mjaggi
2017-09-07 16:57   ` Andre Przywara
2017-09-14 11:21   ` Julien Grall
2017-09-05 17:15 ` [PATCH v3 5/5] ARM: ITS: Expose ITS in the MADT table mjaggi
2017-09-07 16:57   ` Andre Przywara

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=7809520d-7e06-6df7-959f-db2e9a07d2d8@arm.com \
    --to=julien.grall@arm.com \
    --cc=Andre.Przywara@arm.com \
    --cc=mjaggi@cavium.com \
    --cc=mjaggi@caviumnetworks.com \
    --cc=sstabellini@kernel.org \
    --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).