nds32: fix allmodconfig build
v2 cover nds32: fix allmodconfig build
Hi,
This patchset is used to fix the allmodconfig building errors.
Changes in v2:
- To fix the endian mismatch issue.
- Use EXPORT_SYMBOL(save_stack_trace) like other architectures.
Greentime Hu (9):
nds32: lib: To use generic lib instead of libgcc to prevent the symbol
undefined issue.
nds32: Fix building error when CONFIG_FREEZE is enabled.
nds32: Fix building error of crypto/xor.c by adding xor.h
nds32: Fix drivers/gpu/drm/udl/udl_fb.c building error by defining
PAGE_SHARED
nds32: Fix xfs_buf built failed by export invalidate_kernel_vmap_range
and flush_kernel_vmap_range
nds32: Fix the symbols undefined issue by exporting them.
nds32: Fix the unknown type u8 issue.
nds32: Fix build failed because arch_trace_hardirqs_off is changed to
trace_hardirqs_off.
nds32: Fix the allmodconfig build. To make sure
CONFIG_CPU_LITTLE_ENDIAN is default y
arch/nds32/Kconfig | 7 +++++++ arch/nds32/Kconfig.cpu | 5 +++-- arch/nds32/Makefile | 7 ++++--- arch/nds32/include/asm/Kbuild | 2 ++ arch/nds32/include/asm/cacheflush.h | 2 ++ arch/nds32/include/asm/io.h | 2 ++ arch/nds32/include/asm/page.h | 3 +++ arch/nds32/include/asm/pgtable.h | 1 + arch/nds32/kernel/ex-entry.S | 2 +- arch/nds32/kernel/stacktrace.c | 2 ++ arch/nds32/lib/copy_page.S | 3 +++ arch/nds32/mm/cacheflush.c | 40 +++++++++++++++++++++++++++++++++++++ arch/nds32/mm/init.c | 1 + 13 files changed, 71 insertions(+), 6 deletions(-)
Signature · 1 line
1.9.5
PATCH v2 1/9 nds32: lib: To use generic lib instead of libgcc to prevent the symbol undefined issue.
We can use the generic lib to fix these error because the symbol of libgcc in toolchain is not exported.
ERROR: "__ucmpdi2" [fs/xfs/xfs.ko] undefined!
ERROR: "__ashrdi3" [fs/xfs/xfs.ko] undefined!
ERROR: "__lshrdi3" [fs/xfs/xfs.ko] undefined!
ERROR: "__ashldi3" [fs/ntfs/ntfs.ko] undefined!
...
--- arch/nds32/Kconfig | 6 ++++++ arch/nds32/Makefile | 3 --- 2 files changed, 6 insertions(+), 3 deletions(-)
arch/nds32/Kconfig +6 -0
@@ -9,6 +9,12 @@ config NDS32 select CLKSRC_MMIO select CLONE_BACKWARDS select COMMON_CLK + select GENERIC_ASHLDI3 + select GENERIC_ASHRDI3 + select GENERIC_LSHRDI3 + select GENERIC_CMPDI2 + select GENERIC_MULDI3 + select GENERIC_UCMPDI2 select GENERIC_ATOMIC64 select GENERIC_CPU_DEVICES select GENERIC_CLOCKEVENTS
arch/nds32/Makefile +0 -3
@@ -23,9 +23,6 @@ export TEXTADDR # If we have a machine-specific directory, then include it in the build. core-y += arch/nds32/kernel/ arch/nds32/mm/ libs-y += arch/nds32/lib/ -LIBGCC_PATH := \ - $(shell $(CC) $(KBUILD_CFLAGS) $(KCFLAGS) -print-libgcc-file-name) -libs-y += $(LIBGCC_PATH) ifneq '$(CONFIG_NDS32_BUILTIN_DTB)' '""' BUILTIN_DTB := y
Signature · 1 line
1.9.5
PATCH v2 3/9 nds32: Fix building error of crypto/xor.c by adding xor.h
In reply to Greentime HuWhen I compiled with allmodconfig, it caused this building failed. crypto/xor.c:25:21: fatal error: asm/xor.h: No such file or directory
#include <asm/xor.h>
^compilation terminated.
--- arch/nds32/include/asm/Kbuild | 1 + 1 file changed, 1 insertion(+)
arch/nds32/include/asm/Kbuild +1 -0
@@ -49,6 +49,7 @@ generic-y += switch_to.h generic-y += timex.h generic-y += topology.h generic-y += trace_clock.h +generic-y += xor.h generic-y += unaligned.h generic-y += user.h generic-y += vga.h
Signature · 1 line
1.9.5
PATCH v2 6/9 nds32: Fix the symbols undefined issue by exporting them.
In reply to Greentime HuIt broke the 'allmodconfig' build.
LD vmlinux
SYSMAP System.map
Building modules, stage 2.
MODPOST 5028 modules
ERROR: "flush_dcache_page" [net/sunrpc/xprtrdma/rpcrdma.ko] undefined!
ERROR: "empty_zero_page" [net/ceph/libceph.ko] undefined!
ERROR: "save_stack_trace" [kernel/backtracetest.ko] undefined!
ERROR: "clear_page" [fs/ocfs2/dlm/ocfs2_dlm.ko] undefined!
ERROR: "copy_page" [fs/nilfs2/nilfs2.ko] undefined!
...
--- arch/nds32/include/asm/Kbuild | 1 + arch/nds32/include/asm/page.h | 3 +++ arch/nds32/kernel/stacktrace.c | 2 ++ arch/nds32/lib/copy_page.S | 3 +++ arch/nds32/mm/cacheflush.c | 22 ++++++++++++++++++++++ arch/nds32/mm/init.c | 1 + 6 files changed, 32 insertions(+)
arch/nds32/include/asm/Kbuild +1 -0
@@ -16,6 +16,7 @@ generic-y += dma.h generic-y += emergency-restart.h generic-y += errno.h generic-y += exec.h +generic-y += export.h generic-y += fb.h generic-y += fcntl.h generic-y += ftrace.h
arch/nds32/include/asm/page.h +3 -0
@@ -27,6 +27,9 @@ extern void copy_user_highpage(struct page *to, struct page *from, unsigned long vaddr, struct vm_area_struct *vma);extern void clear_user_highpage (struct page *page,unsigned long vaddr); +void copy_user_page (void *vto,void *vfrom,unsigned long vaddr, +struct page *to); +void clear_user_page (void *addr,unsigned long vaddr,struct page *page);#define __HAVE_ARCH_COPY_USER_HIGHPAGE#define clear_user_highpage clear_user_highpage#else
arch/nds32/kernel/stacktrace.c +2 -0
@@ -9,6 +9,7 @@ void save_stack_trace(struct stack_trace *trace) {save_stack_trace_tsk (current, trace); } +EXPORT_SYMBOL_GPL (save_stack_trace);void save_stack_trace_tsk (struct task_struct *tsk,struct stack_trace *trace) {
@@ -45,3 +46,4 @@ void save_stack_trace_tsk(struct task_struct *tsk, struct stack_trace *trace) fpn = (unsigned long *)fpp; } } +EXPORT_SYMBOL_GPL (save_stack_trace_tsk);
arch/nds32/lib/copy_page.S +3 -0
@@ -2,6 +2,7 @@ // Copyright (C) 2005-2017 Andes Technology Corporation #include <linux/linkage.h> +#include <asm/export.h> #include <asm/page.h> .text
@@ -16,6 +17,7 @@ ENTRY(copy_page) popm $r2, $r10 ret ENDPROC(copy_page) +EXPORT_SYMBOL(copy_page) ENTRY(clear_page) pushm $r1, $r9
@@ -35,3 +37,4 @@ ENTRY(clear_page) popm $r1, $r9 ret ENDPROC(clear_page) +EXPORT_SYMBOL(clear_page)
arch/nds32/mm/cacheflush.c +22 -0
@@ -147,6 +147,25 @@ void flush_cache_vunmap(unsigned long start, unsigned long end)cpu_icache_inval_all (); } +void copy_user_page (void *vto,void *vfrom,unsigned long vaddr, +struct page *to) +{ +cpu_dcache_wbinval_page ((unsigned long )vaddr); +cpu_icache_inval_page ((unsigned long )vaddr); +copy_page (vto, vfrom); +cpu_dcache_wbinval_page ((unsigned long )vto); +cpu_icache_inval_page ((unsigned long )vto); +} + +void clear_user_page (void *addr,unsigned long vaddr,struct page *page) +{ +cpu_dcache_wbinval_page ((unsigned long )vaddr); +cpu_icache_inval_page ((unsigned long )vaddr); +clear_page (addr); +cpu_dcache_wbinval_page ((unsigned long )addr); +cpu_icache_inval_page ((unsigned long )addr); +} +void copy_user_highpage (struct page *to,struct page *from,unsigned long vaddr,struct vm_area_struct *vma) {
@@ -213,6 +232,7 @@ void flush_dcache_page(struct page *page)local_irq_restore (flags); } } +EXPORT_SYMBOL (flush_dcache_page);void copy_to_user_page (struct vm_area_struct *vma,struct page *page,unsigned long vaddr,void *dst,void *src,int len)
@@ -272,6 +292,7 @@ void flush_kernel_dcache_page(struct page *page)cpu_dcache_wbinval_page ((unsigned long )page_address (page));local_irq_restore (flags); } +EXPORT_SYMBOL (flush_kernel_dcache_page);void flush_kernel_vmap_range (void *addr,int size) {
@@ -301,6 +322,7 @@ void flush_icache_range(unsigned long start, unsigned long end)cpu_cache_wbinval_range (start, end,1 );local_irq_restore (flags); } +EXPORT_SYMBOL (flush_icache_range);void flush_icache_page (struct vm_area_struct *vma,struct page *page) {
arch/nds32/mm/init.c +1 -0
@@ -30,6 +30,7 @@* zero-initialized data and COW. */ struct page *empty_zero_page; +EXPORT_SYMBOL (empty_zero_page);static void __init zone_sizes_init (void ) {
Signature · 1 line
1.9.5
PATCH v2 9/9 nds32: Fix the allmodconfig build. To make sure CONFIG_CPU_LITTLE_ENDIAN is default y
In reply to Greentime HuThis way we can build kernel with CONFIG_CPU_LITTLE_ENDIAN=y. Build allmodconfig and allnoconfig are available too. It also fix the endian mismatch issue because AFLAGS and LDFLAGS is not passed correctly.
--- arch/nds32/Kconfig.cpu | 5 +++-- arch/nds32/Makefile | 4 ++++ 2 files changed, 7 insertions(+), 2 deletions(-)
arch/nds32/Kconfig.cpu +3 -2
@@ -1,10 +1,11 @@ comment "Processor Features" config CPU_BIG_ENDIAN - bool "Big endian" + def_bool !CPU_LITTLE_ENDIAN config CPU_LITTLE_ENDIAN - def_bool !CPU_BIG_ENDIAN + bool "Little endian" + default y config HWZOL bool "hardware zero overhead loop support"
arch/nds32/Makefile +4 -0
@@ -32,8 +32,12 @@ endif ifdef CONFIG_CPU_LITTLE_ENDIAN KBUILD_CFLAGS += $(call cc-option, -EL) +KBUILD_AFLAGS += $(call cc-option, -EL) +LDFLAGS += $(call cc-option, -EL) else KBUILD_CFLAGS += $(call cc-option, -EB) +KBUILD_AFLAGS += $(call cc-option, -EB) +LDFLAGS += $(call cc-option, -EB) endif boot := arch/nds32/boot
Signature · 1 line
1.9.5
PATCH v2 8/9 nds32: Fix build failed because arch_trace_hardirqs_off is changed to trace_hardirqs_off.
In reply to Greentime HuIt broke the 'allmodconfig' build when CONFIG_TRACE_IRQFLAGS is enabled.
--- arch/nds32/kernel/ex-entry.S | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
arch/nds32/kernel/ex-entry.S +1 -1
@@ -118,7 +118,7 @@ common_exception_handler: /* interrupt */ 2: #ifdef CONFIG_TRACE_IRQFLAGS - jal arch_trace_hardirqs_off + jal trace_hardirqs_off #endif move $r0, $sp sethi $lp, hi20(ret_from_intr)
Signature · 1 line
1.9.5
PATCH v2 7/9 nds32: Fix the unknown type u8 issue.
In reply to Greentime HuIt broke the 'allmodconfig' build.
We need to include <linux/types.h> to make sure the type is defined before using it.
--- arch/nds32/include/asm/io.h | 2 ++ 1 file changed, 2 insertions(+)
arch/nds32/include/asm/io.h +2 -0
@@ -4,6 +4,8 @@#ifndef __ASM_NDS32_IO_H#define __ASM_NDS32_IO_H +#include <linux/types.h> +extern void iounmap (volatile void __iomem *addr);#define __raw_writeb __raw_writebstatic inline void __raw_writeb (u8 val,volatile void __iomem *addr)
Signature · 1 line
1.9.5
PATCH v2 5/9 nds32: Fix xfs_buf built failed by export invalidate_kernel_vmap_range and flush_kernel_vmap_range
In reply to Greentime HuIt broke the 'allmodconfig' build.fs/xfs/xfs_buf.c: In function 'xfs_buf_bio_end_io':fs/xfs/xfs_buf.c:1242:3: error: implicit declaration of function 'invalidate_kernel_vmap_range' [-Werror=implicit-function-declaration]
invalidate_kernel_vmap_range(bp->b_addr, xfs_buf_vmap_len(bp));
^~~~~~~~~~~~~~~~~~~~~~~~~~~~fs/xfs/xfs_buf.c: In function 'xfs_buf_ioapply_map':fs/xfs/xfs_buf.c:1312:4: error: implicit declaration of function 'flush_kernel_vmap_range' [-Werror=implicit-function-declaration]
flush_kernel_vmap_range(bp->b_addr,
^~~~~~~~~~~~~~~~~~~~~~~--- arch/nds32/include/asm/cacheflush.h | 2 ++ arch/nds32/mm/cacheflush.c | 18 ++++++++++++++++++ 2 files changed, 20 insertions(+)
arch/nds32/include/asm/cacheflush.h +2 -0
@@ -32,6 +32,8 @@ void flush_anon_page(struct vm_area_struct *vma,#define ARCH_HAS_FLUSH_KERNEL_DCACHE_PAGE void flush_kernel_dcache_page (struct page *page); +void flush_kernel_vmap_range (void *addr,int size); +void invalidate_kernel_vmap_range (void *addr,int size);void flush_icache_range (unsigned long start,unsigned long end);void flush_icache_page (struct vm_area_struct *vma,struct page *page);#define flush_dcache_mmap_lock (mapping) xa_lock_irq(&(mapping)->i_pages)
arch/nds32/mm/cacheflush.c +18 -0
@@ -273,6 +273,24 @@ void flush_kernel_dcache_page(struct page *page)local_irq_restore (flags); } +void flush_kernel_vmap_range (void *addr,int size) +{ +unsigned long flags; +local_irq_save (flags); +cpu_dcache_wb_range ((unsigned long )addr, (unsigned long )addr + size); +local_irq_restore (flags); +} +EXPORT_SYMBOL (flush_kernel_vmap_range); + +void invalidate_kernel_vmap_range (void *addr,int size) +{ +unsigned long flags; +local_irq_save (flags); +cpu_dcache_inval_range ((unsigned long )addr, (unsigned long )addr + size); +local_irq_restore (flags); +} +EXPORT_SYMBOL (invalidate_kernel_vmap_range); +void flush_icache_range (unsigned long start,unsigned long end) {unsigned long line_size, flags;
Signature · 1 line
1.9.5
PATCH v2 4/9 nds32: Fix drivers/gpu/drm/udl/udl_fb.c building error by defining PAGE_SHARED
In reply to Greentime HuIt broke the 'allmodconfig' build.drivers/gpu/drm/udl/udl_fb.c: In function 'udl_fb_mmap':drivers/gpu/drm/udl/udl_fb.c:183:52: error: 'PAGE_SHARED' undeclared (first use in this function)
if (remap_pfn_range(vma, start, page, PAGE_SIZE, PAGE_SHARED))
^~~~~~~~~~~
drivers/gpu/drm/udl/udl_fb.c:183:52: note: each undeclared identifier is reported only once for each function it appears in make[4]: *** [drivers/gpu/drm/udl/udl_fb.o] Error 1
--- arch/nds32/include/asm/pgtable.h | 1 + 1 file changed, 1 insertion(+)
arch/nds32/include/asm/pgtable.h +1 -0
@@ -152,6 +152,7 @@#define PAGE_CACHE_L1 __pgprot(_HAVE_PAGE_L | _PAGE_V | _PAGE_M_KRW | _PAGE_D | _PAGE_E | _PAGE_G | _PAGE_CACHE)#define PAGE_MEMORY __pgprot(_HAVE_PAGE_L | _PAGE_V | _PAGE_M_KRW | _PAGE_D | _PAGE_E | _PAGE_G | _PAGE_CACHE_SHRD)#define PAGE_KERNEL __pgprot(_PAGE_V | _PAGE_M_KRW | _PAGE_D | _PAGE_E | _PAGE_G | _PAGE_CACHE_SHRD) +#define PAGE_SHARED __pgprot(_PAGE_V | _PAGE_M_URW_KRW | _PAGE_D | _PAGE_CACHE_SHRD)#define PAGE_DEVICE __pgprot(_PAGE_V | _PAGE_M_KRW | _PAGE_D | _PAGE_G | _PAGE_C_DEV)#endif /* __ASSEMBLY__ */
Signature · 1 line
1.9.5
PATCH v2 2/9 nds32: Fix building error when CONFIG_FREEZE is enabled.
In reply to Greentime HuTo include kernel/Kconfig.freezer to make sure the dependency between CONFIG_CGROUP_FREEZER and CONFIG_FREEZER
It will cause building error when I make allmodconfig.
kernel/cgroup/freezer.c: In function 'freezer_css_online':kernel/cgroup/freezer.c:116:15: error: 'system_freezing_cnt' undeclared (first use in this function)
atomic_inc(&system_freezing_cnt);
^~~~~~~~~~~~~~~~~~~
kernel/cgroup/freezer.c:116:15: note: each undeclared identifier is reported only once for each function it appears in
kernel/cgroup/freezer.c: In function 'freezer_css_offline':
kernel/cgroup/freezer.c:137:15: error: 'system_freezing_cnt' undeclared (first use in this function)
atomic_dec(&system_freezing_cnt);
^~~~~~~~~~~~~~~~~~~
kernel/cgroup/freezer.c: In function 'freezer_attach':
kernel/cgroup/freezer.c:181:4: error: implicit declaration of function 'freeze_task' [-Werror=implicit-function-declaration]
freeze_task(task);
^~~~~~~~~~~
kernel/cgroup/freezer.c: In function 'freezer_apply_state':
kernel/cgroup/freezer.c:360:16: error: 'system_freezing_cnt' undeclared (first use in this function)
atomic_inc(&system_freezing_cnt);
^~~~~~~~~~~~~~~~~~~--- arch/nds32/Kconfig | 1 + 1 file changed, 1 insertion(+)
arch/nds32/Kconfig +1 -0
@@ -88,6 +88,7 @@ endmenu menu "Kernel Features" source "kernel/Kconfig.preempt" +source "kernel/Kconfig.freezer" source "mm/Kconfig" source "kernel/Kconfig.hz" endmenu
Signature · 1 line
1.9.5