From ce372128a79bc2db9966302fb1e3608194455ca7 Mon Sep 17 00:00:00 2001 From: Masahiro Yamada Date: Mon, 1 Mar 2021 23:23:02 +0900 Subject: microblaze: syscalls: switch to generic syscalltbl.sh Many architectures duplicate similar shell scripts. This commit converts microblaze to use scripts/syscalltbl.sh. Signed-off-by: Masahiro Yamada Link: https://lore.kernel.org/r/20210301142303.343727-1-masahiroy@kernel.org Signed-off-by: Michal Simek --- arch/microblaze/kernel/syscall_table.S | 3 +-- arch/microblaze/kernel/syscalls/Makefile | 7 ++---- arch/microblaze/kernel/syscalls/syscalltbl.sh | 32 --------------------------- 3 files changed, 3 insertions(+), 39 deletions(-) delete mode 100644 arch/microblaze/kernel/syscalls/syscalltbl.sh (limited to 'arch') diff --git a/arch/microblaze/kernel/syscall_table.S b/arch/microblaze/kernel/syscall_table.S index ce006646f741..3bc60a2b159e 100644 --- a/arch/microblaze/kernel/syscall_table.S +++ b/arch/microblaze/kernel/syscall_table.S @@ -1,6 +1,5 @@ /* SPDX-License-Identifier: GPL-2.0 */ -#define __SYSCALL(nr, entry, nargs) .long entry +#define __SYSCALL(nr, entry) .long entry ENTRY(sys_call_table) #include -#undef __SYSCALL diff --git a/arch/microblaze/kernel/syscalls/Makefile b/arch/microblaze/kernel/syscalls/Makefile index 285aaba832d9..ad2492cb5568 100644 --- a/arch/microblaze/kernel/syscalls/Makefile +++ b/arch/microblaze/kernel/syscalls/Makefile @@ -7,7 +7,7 @@ _dummy := $(shell [ -d '$(uapi)' ] || mkdir -p '$(uapi)') \ syscall := $(src)/syscall.tbl syshdr := $(srctree)/$(src)/syscallhdr.sh -systbl := $(srctree)/$(src)/syscalltbl.sh +systbl := $(srctree)/scripts/syscalltbl.sh quiet_cmd_syshdr = SYSHDR $@ cmd_syshdr = $(CONFIG_SHELL) '$(syshdr)' '$<' '$@' \ @@ -16,10 +16,7 @@ quiet_cmd_syshdr = SYSHDR $@ '$(syshdr_offset_$(basetarget))' quiet_cmd_systbl = SYSTBL $@ - cmd_systbl = $(CONFIG_SHELL) '$(systbl)' '$<' '$@' \ - '$(systbl_abis_$(basetarget))' \ - '$(systbl_abi_$(basetarget))' \ - '$(systbl_offset_$(basetarget))' + cmd_systbl = $(CONFIG_SHELL) $(systbl) $< $@ $(uapi)/unistd_32.h: $(syscall) $(syshdr) FORCE $(call if_changed,syshdr) diff --git a/arch/microblaze/kernel/syscalls/syscalltbl.sh b/arch/microblaze/kernel/syscalls/syscalltbl.sh deleted file mode 100644 index 85d78d9309ad..000000000000 --- a/arch/microblaze/kernel/syscalls/syscalltbl.sh +++ /dev/null @@ -1,32 +0,0 @@ -#!/bin/sh -# SPDX-License-Identifier: GPL-2.0 - -in="$1" -out="$2" -my_abis=`echo "($3)" | tr ',' '|'` -my_abi="$4" -offset="$5" - -emit() { - t_nxt="$1" - t_nr="$2" - t_entry="$3" - - while [ $t_nxt -lt $t_nr ]; do - printf "__SYSCALL(%s, sys_ni_syscall, )\n" "${t_nxt}" - t_nxt=$((t_nxt+1)) - done - printf "__SYSCALL(%s, %s, )\n" "${t_nxt}" "${t_entry}" -} - -grep -E "^[0-9A-Fa-fXx]+[[:space:]]+${my_abis}" "$in" | sort -n | ( - nxt=0 - if [ -z "$offset" ]; then - offset=0 - fi - - while read nr abi name entry ; do - emit $((nxt+offset)) $((nr+offset)) $entry - nxt=$((nr+1)) - done -) > "$out" -- cgit v1.2.3 From 64f416c86973fc56bdabd1b842a6b29dad400f0a Mon Sep 17 00:00:00 2001 From: Masahiro Yamada Date: Mon, 1 Mar 2021 23:23:03 +0900 Subject: microblaze: syscalls: switch to generic syscallhdr.sh Many architectures duplicate similar shell scripts. This commit converts microblaze to use scripts/syscallhdr.sh. Signed-off-by: Masahiro Yamada Link: https://lore.kernel.org/r/20210301142303.343727-2-masahiroy@kernel.org Signed-off-by: Michal Simek --- arch/microblaze/kernel/syscalls/Makefile | 7 ++---- arch/microblaze/kernel/syscalls/syscallhdr.sh | 36 --------------------------- 2 files changed, 2 insertions(+), 41 deletions(-) delete mode 100644 arch/microblaze/kernel/syscalls/syscallhdr.sh (limited to 'arch') diff --git a/arch/microblaze/kernel/syscalls/Makefile b/arch/microblaze/kernel/syscalls/Makefile index ad2492cb5568..6713c65a25e1 100644 --- a/arch/microblaze/kernel/syscalls/Makefile +++ b/arch/microblaze/kernel/syscalls/Makefile @@ -6,14 +6,11 @@ _dummy := $(shell [ -d '$(uapi)' ] || mkdir -p '$(uapi)') \ $(shell [ -d '$(kapi)' ] || mkdir -p '$(kapi)') syscall := $(src)/syscall.tbl -syshdr := $(srctree)/$(src)/syscallhdr.sh +syshdr := $(srctree)/scripts/syscallhdr.sh systbl := $(srctree)/scripts/syscalltbl.sh quiet_cmd_syshdr = SYSHDR $@ - cmd_syshdr = $(CONFIG_SHELL) '$(syshdr)' '$<' '$@' \ - '$(syshdr_abis_$(basetarget))' \ - '$(syshdr_pfx_$(basetarget))' \ - '$(syshdr_offset_$(basetarget))' + cmd_syshdr = $(CONFIG_SHELL) $(syshdr) --emit-nr $< $@ quiet_cmd_systbl = SYSTBL $@ cmd_systbl = $(CONFIG_SHELL) $(systbl) $< $@ diff --git a/arch/microblaze/kernel/syscalls/syscallhdr.sh b/arch/microblaze/kernel/syscalls/syscallhdr.sh deleted file mode 100644 index a914854f8d9f..000000000000 --- a/arch/microblaze/kernel/syscalls/syscallhdr.sh +++ /dev/null @@ -1,36 +0,0 @@ -#!/bin/sh -# SPDX-License-Identifier: GPL-2.0 - -in="$1" -out="$2" -my_abis=`echo "($3)" | tr ',' '|'` -prefix="$4" -offset="$5" - -fileguard=_UAPI_ASM_MICROBLAZE_`basename "$out" | sed \ - -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/' \ - -e 's/[^A-Z0-9_]/_/g' -e 's/__/_/g'` -grep -E "^[0-9A-Fa-fXx]+[[:space:]]+${my_abis}" "$in" | sort -n | ( - printf "#ifndef %s\n" "${fileguard}" - printf "#define %s\n" "${fileguard}" - printf "\n" - - nxt=0 - while read nr abi name entry ; do - if [ -z "$offset" ]; then - printf "#define __NR_%s%s\t%s\n" \ - "${prefix}" "${name}" "${nr}" - else - printf "#define __NR_%s%s\t(%s + %s)\n" \ - "${prefix}" "${name}" "${offset}" "${nr}" - fi - nxt=$((nr+1)) - done - - printf "\n" - printf "#ifdef __KERNEL__\n" - printf "#define __NR_syscalls\t%s\n" "${nxt}" - printf "#endif\n" - printf "\n" - printf "#endif /* %s */\n" "${fileguard}" -) > "$out" -- cgit v1.2.3 From 9dc12e4ccd97c07d5c9ed9ea4a75a5e16bc3700e Mon Sep 17 00:00:00 2001 From: David Hildenbrand Date: Mon, 1 Mar 2021 12:47:49 +0100 Subject: microblaze: tag highmem_setup() with __meminit With commit a0cd7a7c4bc0 ("mm: simplify free_highmem_page() and free_reserved_page()") the kernel test robot complains about a warning: WARNING: modpost: vmlinux.o(.text.unlikely+0x23ac): Section mismatch in reference from the function highmem_setup() to the function .meminit.text:memblock_is_reserved() This has been broken ever since microblaze added highmem support, because memblock_is_reserved() was already tagged with "__init" back then - most probably the function always got inlined, so we never stumbled over it. We need __meminit because __init_memblock defaults to that without CONFIG_ARCH_KEEP_MEMBLOCK" and __init_memblock is not used outside memblock code. Reported-by: kernel test robot Fixes: 2f2f371f8907 ("microblaze: Highmem support") Cc: Andrew Morton Cc: Michal Simek Cc: Mike Rapoport Cc: Andrew Morton Cc: Thomas Gleixner Cc: Arvind Sankar Cc: Ira Weiny Cc: Randy Dunlap Cc: Oscar Salvador Cc: Anshuman Khandual Signed-off-by: David Hildenbrand Reviewed-by: Oscar Salvador Link: https://lore.kernel.org/r/20210301114749.47914-1-david@redhat.com Signed-off-by: Michal Simek --- arch/microblaze/mm/init.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'arch') diff --git a/arch/microblaze/mm/init.c b/arch/microblaze/mm/init.c index 181e48782e6c..05cf1fb3f5ff 100644 --- a/arch/microblaze/mm/init.c +++ b/arch/microblaze/mm/init.c @@ -52,7 +52,7 @@ static void __init highmem_init(void) pkmap_page_table = virt_to_kpte(PKMAP_BASE); } -static void highmem_setup(void) +static void __meminit highmem_setup(void) { unsigned long pfn; -- cgit v1.2.3 From bbcee72c2f7ad889be7513d5e700165c3cb30e60 Mon Sep 17 00:00:00 2001 From: Bhaskar Chowdhury Date: Fri, 19 Mar 2021 10:23:23 +0530 Subject: microblaze: Fix a typo s/storign/storing/ Signed-off-by: Bhaskar Chowdhury Link: https://lore.kernel.org/r/20210319045323.21241-1-unixbhaskar@gmail.com Acked-by: Randy Dunlap Signed-off-by: Michal Simek --- arch/microblaze/lib/uaccess_old.S | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'arch') diff --git a/arch/microblaze/lib/uaccess_old.S b/arch/microblaze/lib/uaccess_old.S index 0e8cc2710c27..eca290090038 100644 --- a/arch/microblaze/lib/uaccess_old.S +++ b/arch/microblaze/lib/uaccess_old.S @@ -188,7 +188,7 @@ w2: sw r4, r5, r3 .text .align 4 /* Alignment is important to keep icache happy */ -page: /* Create room on stack and save registers for storign values */ +page: /* Create room on stack and save registers for storing values */ addik r1, r1, -40 swi r5, r1, 0 swi r6, r1, 4 -- cgit v1.2.3 From 47de4477a8e6bfd202640567ce4bf17cc1de60be Mon Sep 17 00:00:00 2001 From: Randy Dunlap Date: Tue, 20 Apr 2021 19:20:41 -0700 Subject: microblaze: add 'fallthrough' to memcpy/memset/memmove Fix "fallthrough" warnings in microblaze memcpy/memset/memmove library functions. CC arch/microblaze/lib/memcpy.o ../arch/microblaze/lib/memcpy.c: In function 'memcpy': ../arch/microblaze/lib/memcpy.c:70:4: warning: this statement may fall through [-Wimplicit-fallthrough=] 70 | --c; ../arch/microblaze/lib/memcpy.c:71:3: note: here 71 | case 2: ../arch/microblaze/lib/memcpy.c:73:4: warning: this statement may fall through [-Wimplicit-fallthrough=] 73 | --c; ../arch/microblaze/lib/memcpy.c:74:3: note: here 74 | case 3: ../arch/microblaze/lib/memcpy.c:178:10: warning: this statement may fall through [-Wimplicit-fallthrough=] 178 | *dst++ = *src++; ../arch/microblaze/lib/memcpy.c:179:2: note: here 179 | case 2: ../arch/microblaze/lib/memcpy.c:180:10: warning: this statement may fall through [-Wimplicit-fallthrough=] 180 | *dst++ = *src++; ../arch/microblaze/lib/memcpy.c:181:2: note: here 181 | case 1: CC arch/microblaze/lib/memset.o ../arch/microblaze/lib/memset.c: In function 'memset': ../arch/microblaze/lib/memset.c:71:4: warning: this statement may fall through [-Wimplicit-fallthrough=] 71 | --n; ../arch/microblaze/lib/memset.c:72:3: note: here 72 | case 2: ../arch/microblaze/lib/memset.c:74:4: warning: this statement may fall through [-Wimplicit-fallthrough=] 74 | --n; ../arch/microblaze/lib/memset.c:75:3: note: here 75 | case 3: CC arch/microblaze/lib/memmove.o ../arch/microblaze/lib/memmove.c: In function 'memmove': ../arch/microblaze/lib/memmove.c:92:4: warning: this statement may fall through [-Wimplicit-fallthrough=] 92 | --c; ../arch/microblaze/lib/memmove.c:93:3: note: here 93 | case 2: ../arch/microblaze/lib/memmove.c:95:4: warning: this statement may fall through [-Wimplicit-fallthrough=] 95 | --c; ../arch/microblaze/lib/memmove.c:96:3: note: here 96 | case 1: ../arch/microblaze/lib/memmove.c:203:10: warning: this statement may fall through [-Wimplicit-fallthrough=] 203 | *--dst = *--src; ../arch/microblaze/lib/memmove.c:204:2: note: here 204 | case 3: ../arch/microblaze/lib/memmove.c:205:10: warning: this statement may fall through [-Wimplicit-fallthrough=] 205 | *--dst = *--src; ../arch/microblaze/lib/memmove.c:206:2: note: here 206 | case 2: ../arch/microblaze/lib/memmove.c:207:10: warning: this statement may fall through [-Wimplicit-fallthrough=] 207 | *--dst = *--src; ../arch/microblaze/lib/memmove.c:208:2: note: here 208 | case 1: Signed-off-by: Randy Dunlap Cc: Michal Simek Link: https://lore.kernel.org/r/20210421022041.10689-1-rdunlap@infradead.org Signed-off-by: Michal Simek --- arch/microblaze/lib/memcpy.c | 4 ++++ arch/microblaze/lib/memmove.c | 5 +++++ arch/microblaze/lib/memset.c | 2 ++ 3 files changed, 11 insertions(+) (limited to 'arch') diff --git a/arch/microblaze/lib/memcpy.c b/arch/microblaze/lib/memcpy.c index f536e81b8168..63041fdf916d 100644 --- a/arch/microblaze/lib/memcpy.c +++ b/arch/microblaze/lib/memcpy.c @@ -68,9 +68,11 @@ void *memcpy(void *v_dst, const void *v_src, __kernel_size_t c) case 1: *dst++ = *src++; --c; + fallthrough; case 2: *dst++ = *src++; --c; + fallthrough; case 3: *dst++ = *src++; --c; @@ -176,8 +178,10 @@ void *memcpy(void *v_dst, const void *v_src, __kernel_size_t c) switch (c) { case 3: *dst++ = *src++; + fallthrough; case 2: *dst++ = *src++; + fallthrough; case 1: *dst++ = *src++; } diff --git a/arch/microblaze/lib/memmove.c b/arch/microblaze/lib/memmove.c index 3611ce70415b..9862f6b1e59d 100644 --- a/arch/microblaze/lib/memmove.c +++ b/arch/microblaze/lib/memmove.c @@ -90,9 +90,11 @@ void *memmove(void *v_dst, const void *v_src, __kernel_size_t c) case 3: *--dst = *--src; --c; + fallthrough; case 2: *--dst = *--src; --c; + fallthrough; case 1: *--dst = *--src; --c; @@ -201,10 +203,13 @@ void *memmove(void *v_dst, const void *v_src, __kernel_size_t c) switch (c) { case 4: *--dst = *--src; + fallthrough; case 3: *--dst = *--src; + fallthrough; case 2: *--dst = *--src; + fallthrough; case 1: *--dst = *--src; } diff --git a/arch/microblaze/lib/memset.c b/arch/microblaze/lib/memset.c index 04ea72c8a81d..eb6c8988af02 100644 --- a/arch/microblaze/lib/memset.c +++ b/arch/microblaze/lib/memset.c @@ -69,9 +69,11 @@ void *memset(void *v_src, int c, __kernel_size_t n) case 1: *src++ = c; --n; + fallthrough; case 2: *src++ = c; --n; + fallthrough; case 3: *src++ = c; --n; -- cgit v1.2.3