All of lore.kernel.org
 help / color / mirror / Atom feed
From: Ralf Baechle <ralf@linux-mips.org>
To: Huacai Chen <chenhc@lemote.com>
Cc: John Crispin <john@phrozen.org>,
	"Steven J. Hill" <Steven.Hill@imgtec.com>,
	Aurelien Jarno <aurelien@aurel32.net>,
	linux-mips@linux-mips.org, Fuxin Zhang <zhangfx@lemote.com>,
	Zhangjin Wu <wuzhangjin@gmail.com>
Subject: Re: [PATCH V2 4/8] MIPS: Add NUMA support for Loongson-3
Date: Wed, 4 Jun 2014 00:47:39 +0200	[thread overview]
Message-ID: <20140603224739.GU17197@linux-mips.org> (raw)
In-Reply-To: <1397348662-22502-5-git-send-email-chenhc@lemote.com>

On Sun, Apr 13, 2014 at 08:24:18AM +0800, Huacai Chen wrote:

> Multiple Loongson-3A chips can be interconnected with HT0-bus. This is
> a CC-NUMA system that every chip (node) has its own local memory and
> cache coherency is maintained by hardware. The 64-bit physical memory
> address format is as follows:
> 
> 0x-0000-YZZZ-ZZZZ-ZZZZ
> 
> The high 16 bits should be 0, which means the real physical address
> supported by Loongson-3 is 48-bit. The "Y" bits is the base address of
> each node, which can be also considered as the node-id. The "Z" bits is
> the address offset within a node, which means every node has a 44 bits
> address space.
> 
> Signed-off-by: Huacai Chen <chenhc@lemote.com>

> --- a/arch/mips/Kconfig
> +++ b/arch/mips/Kconfig
> @@ -2233,9 +2233,14 @@ config SYS_SUPPORTS_NUMA
>  	bool
>  
>  config NODES_SHIFT
> -	int
> +	int "Maximum Number of NUMA Nodes Shift"
> +	range 1 10
>  	default "6"
>  	depends on NEED_MULTIPLE_NODES
> +	help
> +	  This option specifies the maximum number of available NUMA nodes
> +	  on the target system. MAX_NUMNODES will be 2^(This value).
> +	  If in doubt, use the default.

I always feel a bit uneasy to present options such as NODES_SHIFT to the
user.

> --- a/arch/mips/include/asm/addrspace.h
> +++ b/arch/mips/include/asm/addrspace.h
> @@ -51,8 +51,14 @@
>   * Returns the physical address of a CKSEGx / XKPHYS address
>   */
>  #define CPHYSADDR(a)		((_ACAST32_(a)) & 0x1fffffff)
> +
> +#ifndef CONFIG_NUMA
>  #define XPHYSADDR(a)		((_ACAST64_(a)) &			\
>  				 _CONST64_(0x000000ffffffffff))
> +#else
> +#define XPHYSADDR(a)		((_ACAST64_(a)) &			\
> +				 _CONST64_(0x0000ffffffffffff))
> +#endif

The mask in XPHYSADDR is a function of the processor architecture, not
imlementation, not NUMA.  The latest version of the MIPS architecture
permits PABITS to be as large as 49 bits, so the mask should be
0x0001ffffffffffff.  Always.

> diff --git a/arch/mips/include/asm/sparsemem.h b/arch/mips/include/asm/sparsemem.h
> index d2da53c..c001a90 100644
> --- a/arch/mips/include/asm/sparsemem.h
> +++ b/arch/mips/include/asm/sparsemem.h
> @@ -11,7 +11,12 @@
>  #else
>  # define SECTION_SIZE_BITS	28
>  #endif
> +
> +#ifdef CONFIG_NUMA
> +#define MAX_PHYSMEM_BITS	48
> +#else
>  #define MAX_PHYSMEM_BITS	35
> +#endif

Essentially the same comment as for XPHYSADDR above.

  Ralf

  reply	other threads:[~2014-06-03 22:47 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-04-13  0:24 [PATCH V2 0/8] MIPS: Loongson-3: Add NUMA and Loongson-3B support Huacai Chen
2014-04-13  0:24 ` [PATCH V2 1/8] MIPS: Support hard limit of cpu count (nr_cpu_ids) Huacai Chen
2014-04-14 14:48   ` Andreas Herrmann
2014-04-13  0:24 ` [PATCH V2 2/8] MIPS: Support CPU topology files in sysfs Huacai Chen
2014-04-14 15:04   ` Andreas Herrmann
2014-04-13  0:24 ` [PATCH V2 3/8] MIPS: Loongson: Modify ChipConfig register definition Huacai Chen
2014-04-13  0:24 ` [PATCH V2 4/8] MIPS: Add NUMA support for Loongson-3 Huacai Chen
2014-06-03 22:47   ` Ralf Baechle [this message]
2014-06-03 23:47     ` David Daney
2014-06-04  6:46       ` Ralf Baechle
2014-06-04 17:22         ` David Daney
2014-06-05  9:15           ` Huacai Chen
2014-04-13  0:24 ` [PATCH V2 5/8] MIPS: Add numa api support Huacai Chen
2014-04-13  0:24 ` [PATCH V2 6/8] MIPS: Add Loongson-3B support Huacai Chen
2014-04-13  0:24 ` [PATCH V2 7/8] MIPS: Loongson-3: Enable the COP2 usage Huacai Chen
2014-04-13  0:24 ` [PATCH V2 8/8] MIPS: Loongson: Rename CONFIG_LEMOTE_MACH3A to CONFIG_LOONGSON_MACH3X Huacai Chen

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=20140603224739.GU17197@linux-mips.org \
    --to=ralf@linux-mips.org \
    --cc=Steven.Hill@imgtec.com \
    --cc=aurelien@aurel32.net \
    --cc=chenhc@lemote.com \
    --cc=john@phrozen.org \
    --cc=linux-mips@linux-mips.org \
    --cc=wuzhangjin@gmail.com \
    --cc=zhangfx@lemote.com \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.