tile: fix a -Wframe-larger-than warning
PATCH 1/1 tile: fix a -Wframe-larger-than warning
The warning occurs in setup.c, where it is known that it can't be a problem, but it's still a good idea to silence the warning. The onstack array is converted from an s32 to a u8, which still is plenty of range for the values being managed there.
--- arch/tile/kernel/setup.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
arch/tile/kernel/setup.c +1 -1
@@ -882,7 +882,7 @@ static int __init node_neighbors(int node, int cpu,static void __init setup_numa_mapping (void ) { -int distance[MAX_NUMNODES ][NR_CPUS ]; +u8 distance[MAX_NUMNODES ][NR_CPUS ];HV_Coord coord;int cpu, node, cpus, i, x, y;int num_nodes =num_online_nodes ();
Signature · 1 line
2.1.2
PATCH 1/1 tile: fix tilepro casts for readl, writel, etc
Missing parentheses could cause an argument of the form "integer + pointer" to get cast to "(long)integer + pointer" and remain a pointer type, causing compiler warnings.
--- arch/tile/include/asm/io.h | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-)
arch/tile/include/asm/io.h +8 -8
@@ -161,14 +161,14 @@ extern void _tile_writew(u16 val, unsigned long addr);extern void _tile_writel (u32 val,unsigned long addr);extern void _tile_writeq (u64 val,unsigned long addr); -#define __raw_readb (addr) _tile_readb((unsigned long)addr) -#define __raw_readw (addr) _tile_readw((unsigned long)addr) -#define __raw_readl (addr) _tile_readl((unsigned long)addr) -#define __raw_readq (addr) _tile_readq((unsigned long)addr) -#define __raw_writeb (val, addr) _tile_writeb(val, (unsigned long)addr) -#define __raw_writew (val, addr) _tile_writew(val, (unsigned long)addr) -#define __raw_writel (val, addr) _tile_writel(val, (unsigned long)addr) -#define __raw_writeq (val, addr) _tile_writeq(val, (unsigned long)addr) +#define __raw_readb (addr) _tile_readb((unsigned long)(addr)) +#define __raw_readw (addr) _tile_readw((unsigned long)(addr)) +#define __raw_readl (addr) _tile_readl((unsigned long)(addr)) +#define __raw_readq (addr) _tile_readq((unsigned long)(addr)) +#define __raw_writeb (val, addr) _tile_writeb(val, (unsigned long)(addr)) +#define __raw_writew (val, addr) _tile_writew(val, (unsigned long)(addr)) +#define __raw_writel (val, addr) _tile_writel(val, (unsigned long)(addr)) +#define __raw_writeq (val, addr) _tile_writeq(val, (unsigned long)(addr))#else /* CONFIG_PCI */
Signature · 1 line
2.1.2
PATCH 1/1 tile: provide CONFIG_PAGE_SIZE_64KB etc for tilepro
In reply to Chris MetcalfThis allows the build system to know that it can't attempt to configure the Lustre virtual block device, for example, when tilepro is using 64KB pages (as it does by default). The tilegx build already provided those symbols.
Previously we required that the tilepro hypervisor be rebuilt with a different hardcoded page size in its headers, and then Linux be rebuilt using the updated hypervisor header. Now we allow each of the hypervisor and Linux to be built independently. We still check at boot time to ensure that the page size provided by the hypervisor matches what Linux expects.
--- arch/tile/Kconfig | 11 +++++------ arch/tile/include/asm/page.h | 8 +++++--- 2 files changed, 10 insertions(+), 9 deletions(-)
arch/tile/Kconfig +5 -6
@@ -177,8 +177,6 @@ config NR_CPUS smaller kernel memory footprint results from using a smaller value on chips with fewer tiles. -if TILEGX - choice prompt "Kernel page size" default PAGE_SIZE_64KB
@@ -189,8 +187,11 @@ choice connections, etc., it may be better to select 16KB, which uses memory more efficiently at some cost in TLB performance. - Note that this option is TILE-Gx specific; currently - TILEPro page size is set by rebuilding the hypervisor. + Note that for TILEPro, you must also rebuild the hypervisor + with a matching page size. + +config PAGE_SIZE_4KB + bool "4KB" if TILEPRO config PAGE_SIZE_16KB bool "16KB"
@@ -200,8 +201,6 @@ config PAGE_SIZE_64KB endchoice -endif - source "kernel/Kconfig.hz" config KEXEC
arch/tile/include/asm/page.h +5 -3
@@ -20,15 +20,17 @@#include <arch/chip.h> /* PAGE_SHIFT and HPAGE_SHIFT determine the page sizes. */ -#if defined(CONFIG_PAGE_SIZE_16KB ) +#if defined(CONFIG_PAGE_SIZE_4KB )/* tilepro only */ +#define PAGE_SHIFT 12 +#define CTX_PAGE_FLAG HV_CTX_PG_SM_4K +#elif defined(CONFIG_PAGE_SIZE_16KB )#define PAGE_SHIFT 14#define CTX_PAGE_FLAG HV_CTX_PG_SM_16K#elif defined(CONFIG_PAGE_SIZE_64KB )#define PAGE_SHIFT 16#define CTX_PAGE_FLAG HV_CTX_PG_SM_64K#else -#define PAGE_SHIFT HV_LOG2_DEFAULT_PAGE_SIZE_SMALL -#define CTX_PAGE_FLAG 0 +#error Page size not specified in Kconfig#endif #define HPAGE_SHIFT HV_LOG2_DEFAULT_PAGE_SIZE_LARGE
Signature · 1 line
2.1.2