xen-devel.lists.xenproject.org archive mirror
 help / color / mirror / Atom feed
From: Julien Grall <julien.grall@arm.com>
To: vijay.kilari@gmail.com, sstabellini@kernel.org,
	andre.przywara@arm.com, dario.faggioli@citrix.com
Cc: xen-devel@lists.xenproject.org, nd@arm.com,
	Vijaya Kumar K <Vijaya.Kumar@cavium.com>
Subject: Re: [RFC PATCH v1 18/21] ARM: NUMA: update node_distance with ACPI support
Date: Thu, 2 Mar 2017 17:24:37 +0000	[thread overview]
Message-ID: <7c9bcebe-e77d-f31d-cf02-2c295107ae93@arm.com> (raw)
In-Reply-To: <1486655834-9708-19-git-send-email-vijay.kilari@gmail.com>

Hello Vijay,

On 09/02/17 15:57, vijay.kilari@gmail.com wrote:
> From: Vijaya Kumar K <Vijaya.Kumar@cavium.com>
>
> Update node_distance() function to handle
> ACPI SLIT table information.
>
> Signed-off-by: Vijaya Kumar <Vijaya.Kumar@cavium.com>
> ---
>  xen/arch/arm/numa.c | 20 +++++++++++++++++++-
>  1 file changed, 19 insertions(+), 1 deletion(-)
>
> diff --git a/xen/arch/arm/numa.c b/xen/arch/arm/numa.c
> index 5c49347..50c3dea 100644
> --- a/xen/arch/arm/numa.c
> +++ b/xen/arch/arm/numa.c
> @@ -23,6 +23,7 @@
>  #include <xen/acpi.h>
>  #include <asm/mm.h>
>  #include <xen/numa.h>
> +#include <xen/srat.h>
>  #include <asm/acpi.h>
>  #include <xen/errno.h>
>  #include <xen/cpumask.h>
> @@ -35,6 +36,7 @@ extern struct node nodes[MAX_NUMNODES] __initdata;
>  extern int num_node_memblks;
>  extern struct node node_memblk_range[NR_NODE_MEMBLKS];
>  extern nodeid_t memblk_nodeid[NR_NODE_MEMBLKS];
> +extern struct acpi_table_slit *__read_mostly acpi_slit;
>
>  void __init numa_set_cpu_node(int cpu, unsigned long hwid)
>  {
> @@ -50,9 +52,24 @@ void __init numa_set_cpu_node(int cpu, unsigned long hwid)
>
>  u8 __node_distance(nodeid_t a, nodeid_t b)
>  {
> -    if ( !node_distance )
> +    unsigned index;
> +    u8 slit_val;
> +
> +    if ( !node_distance && !acpi_slit )
>          return a == b ? 10 : 20;
>
> +    if ( acpi_slit )
> +    {
> +        index = acpi_slit->locality_count * node_to_pxm(a);
> +        slit_val = acpi_slit->entry[index + node_to_pxm(b)];
> +
> +        /* ACPI defines 0xff as an unreachable node and 0-9 are undefined */
> +        if ( (slit_val == 0xff) || (slit_val <= 9) )
> +            return NUMA_NO_DISTANCE;
> +        else
> +            return slit_val;
> +    }
> +

arm/numa.c is the generic code and should not contain any ACPI specific 
code.

But as I said, the way to get the distance on ACPI is the same on x86 
and ARM.

So I would introduce __node_distance callback that will be setup at 
boot-time to either point to the ACPI version or DT version.

Regards,

-- 
Julien Grall

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

  reply	other threads:[~2017-03-02 17:24 UTC|newest]

Thread overview: 91+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-02-09 15:56 [RFC PATCH v1 00/21] ARM: Add Xen NUMA support vijay.kilari
2017-02-09 15:56 ` [RFC PATCH v1 01/21] ARM: NUMA: Add existing ARM numa code under CONFIG_NUMA vijay.kilari
2017-02-20 11:39   ` Julien Grall
2017-02-22  9:18     ` Vijay Kilari
2017-02-22 10:49       ` Julien Grall
2017-02-09 15:56 ` [RFC PATCH v1 02/21] x86: NUMA: Refactor NUMA code vijay.kilari
2017-02-09 16:11   ` Jan Beulich
2017-02-20 11:41     ` Julien Grall
2017-02-27 11:43     ` Vijay Kilari
2017-02-27 14:58       ` Jan Beulich
2017-02-20 12:37   ` Julien Grall
2017-02-22 10:04     ` Vijay Kilari
2017-02-22 10:55       ` Julien Grall
2017-02-09 15:56 ` [RFC PATCH v1 03/21] NUMA: Move arch specific NUMA code as common vijay.kilari
2017-02-09 16:15   ` Jan Beulich
2017-02-20 12:47   ` Julien Grall
2017-02-22 10:08     ` Vijay Kilari
2017-02-22 11:07       ` Julien Grall
2017-02-09 15:56 ` [RFC PATCH v1 04/21] NUMA: Refactor generic and arch specific code of numa_setup vijay.kilari
2017-02-20 13:39   ` Julien Grall
2017-02-22 10:27     ` Vijay Kilari
2017-02-22 11:09       ` Julien Grall
2017-02-09 15:56 ` [RFC PATCH v1 05/21] ARM: efi: Do not delete memory node from fdt vijay.kilari
2017-02-20 13:42   ` Julien Grall
2017-02-09 15:56 ` [RFC PATCH v1 06/21] ARM: NUMA: Parse CPU NUMA information vijay.kilari
2017-02-20 17:32   ` Julien Grall
2017-02-22 10:46     ` Vijay Kilari
2017-02-22 11:10       ` Julien Grall
2017-02-20 17:36   ` Julien Grall
2017-02-09 15:56 ` [RFC PATCH v1 07/21] ARM: NUMA: Parse memory " vijay.kilari
2017-02-20 18:05   ` Julien Grall
2017-03-02 12:25     ` Vijay Kilari
2017-03-02 14:48       ` Julien Grall
2017-03-02 15:08         ` Vijay Kilari
2017-03-02 15:19           ` Julien Grall
2017-02-09 15:57 ` [RFC PATCH v1 08/21] ARM: NUMA: Parse NUMA distance information vijay.kilari
2017-02-20 18:28   ` Julien Grall
2017-02-22 11:38     ` Vijay Kilari
2017-02-22 11:44       ` Julien Grall
2017-03-02 12:10         ` Vijay Kilari
2017-03-02 12:17           ` Julien Grall
2017-02-09 15:57 ` [RFC PATCH v1 09/21] ARM: NUMA: Add CPU NUMA support vijay.kilari
2017-02-20 18:32   ` Julien Grall
2017-02-09 15:57 ` [RFC PATCH v1 10/21] ARM: NUMA: Add memory " vijay.kilari
2017-03-02 16:05   ` Julien Grall
2017-03-02 16:23     ` Vijay Kilari
2017-02-09 15:57 ` [RFC PATCH v1 11/21] ARM: NUMA: Add fallback on NUMA failure vijay.kilari
2017-03-02 16:09   ` Julien Grall
2017-03-02 16:25     ` Vijay Kilari
2017-02-09 15:57 ` [RFC PATCH v1 12/21] ARM: NUMA: Do not expose numa info to DOM0 vijay.kilari
2017-02-20 18:36   ` Julien Grall
2017-03-02 12:30     ` Vijay Kilari
2017-02-09 15:57 ` [RFC PATCH v1 13/21] ACPI: Refactor acpi SRAT and SLIT table handling code vijay.kilari
2017-03-02 15:30   ` Julien Grall
2017-03-02 16:31     ` Vijay Kilari
2017-03-02 16:32       ` Julien Grall
2017-02-09 15:57 ` [RFC PATCH v1 14/21] ACPI: Move srat_disabled to common code vijay.kilari
2017-02-09 15:57 ` [RFC PATCH v1 15/21] ARM: NUMA: Extract MPIDR from MADT table vijay.kilari
2017-03-02 16:28   ` Julien Grall
2017-03-02 16:41     ` Vijay Kilari
2017-03-02 16:49       ` Julien Grall
2017-02-09 15:57 ` [RFC PATCH v1 16/21] ARM: NUMA: Extract proximity from SRAT table vijay.kilari
2017-03-02 17:21   ` Julien Grall
2017-03-03 12:39     ` Vijay Kilari
2017-03-03 13:44       ` Julien Grall
2017-03-03 13:50         ` Vijay Kilari
2017-03-03 13:52           ` Julien Grall
2017-03-03 14:45             ` Vijay Kilari
2017-03-03 14:52               ` Julien Grall
2017-03-03 15:16                 ` Vijay Kilari
2017-03-03 15:22                   ` Jan Beulich
2017-03-10 10:53                     ` Vijay Kilari
2017-02-09 15:57 ` [RFC PATCH v1 17/21] ARM: NUMA: Extract memory " vijay.kilari
2017-02-10 17:33   ` Konrad Rzeszutek Wilk
2017-02-10 17:35     ` Konrad Rzeszutek Wilk
2017-03-02 14:41       ` Vijay Kilari
2017-02-09 15:57 ` [RFC PATCH v1 18/21] ARM: NUMA: update node_distance with ACPI support vijay.kilari
2017-03-02 17:24   ` Julien Grall [this message]
2017-03-03 12:43     ` Vijay Kilari
2017-03-03 13:46       ` Julien Grall
2017-02-09 15:57 ` [RFC PATCH v1 19/21] ARM: NUMA: Initialize ACPI NUMA vijay.kilari
2017-03-02 17:25   ` Julien Grall
2017-03-03 12:44     ` Vijay Kilari
2017-02-09 15:57 ` [RFC PATCH v1 20/21] ARM: NUMA: Enable CONFIG_NUMA config vijay.kilari
2017-03-02 17:27   ` Julien Grall
2017-02-09 15:57 ` [RFC PATCH v1 21/21] ARM: NUMA: Enable CONFIG_ACPI_NUMA config vijay.kilari
2017-03-02 17:31   ` Julien Grall
2017-02-09 16:31 ` [RFC PATCH v1 00/21] ARM: Add Xen NUMA support Julien Grall
2017-02-09 16:59   ` Vijay Kilari
2017-02-10 17:30 ` Konrad Rzeszutek Wilk
2017-03-02 14:49   ` Vijay Kilari

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=7c9bcebe-e77d-f31d-cf02-2c295107ae93@arm.com \
    --to=julien.grall@arm.com \
    --cc=Vijaya.Kumar@cavium.com \
    --cc=andre.przywara@arm.com \
    --cc=dario.faggioli@citrix.com \
    --cc=nd@arm.com \
    --cc=sstabellini@kernel.org \
    --cc=vijay.kilari@gmail.com \
    --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).