Re: [PATCH] bug.h: Work around GCC PR82365 in BUG()

2018-04-11 Thread James Hogan
On Wed, Apr 11, 2018 at 12:08:51PM +0200, Arnd Bergmann wrote:
> On Wed, Apr 11, 2018 at 11:54 AM, James Hogan  wrote:
> > On Wed, Apr 11, 2018 at 09:30:56AM +0200, Arnd Bergmann wrote:
> >> On Wed, Apr 11, 2018 at 12:48 AM, James Hogan  wrote:
> >> > Before I forward port those patches to add .insn for MIPS, is that sort
> >> > of approach (an arch specific asm/compiler-gcc.h to allow MIPS to
> >> > override barrier_before_unreachable()) an acceptable fix?
> >>
> >> That sounds fine to me. However, I would suggest making that
> >> asm/compiler.h instead of asm/compiler-gcc.h, so we can also
> >> use the same file to include workarounds for clang if needed.
> >
> > Yes, though there are a few asm/compiler.h's already, and the alpha one
> > includes linux/compiler.h before undefining inline, so seems to have its
> > own specific purpose...
> 
> Interesting. For the other ones, including asm/compiler.h from 
> linux/compiler.h
> seems appropriate though, so the question would be what to do with the
> alpha case. I think we can simply remove that header file and replace
> it with this patch:
> 
> diff --git a/arch/alpha/Kconfig b/arch/alpha/Kconfig
> index b2022885ced8..5502404f54cd 100644
> --- a/arch/alpha/Kconfig
> +++ b/arch/alpha/Kconfig
> @@ -81,6 +81,9 @@ config PGTABLE_LEVELS
> int
> default 3
> 
> +config OPTIMIZE_INLINING
> +   def_bool y
> +
>  source "init/Kconfig"
>  source "kernel/Kconfig.freezer"
> 
> which should have the same effect.

Hmm yes, and I suppose alpha would need ARCH_SUPPORTS_OPTIMIZED_INLINING
too. I'll give it a try.

Cheers
James


signature.asc
Description: Digital signature
___
linux-snps-arc mailing list
linux-snps-arc@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-snps-arc

Re: [PATCH] bug.h: Work around GCC PR82365 in BUG()

2018-04-11 Thread James Hogan
On Wed, Apr 11, 2018 at 09:30:56AM +0200, Arnd Bergmann wrote:
> On Wed, Apr 11, 2018 at 12:48 AM, James Hogan  wrote:
> > Before I forward port those patches to add .insn for MIPS, is that sort
> > of approach (an arch specific asm/compiler-gcc.h to allow MIPS to
> > override barrier_before_unreachable()) an acceptable fix?
> 
> That sounds fine to me. However, I would suggest making that
> asm/compiler.h instead of asm/compiler-gcc.h, so we can also
> use the same file to include workarounds for clang if needed.

Yes, though there are a few asm/compiler.h's already, and the alpha one
includes linux/compiler.h before undefining inline, so seems to have its
own specific purpose...

Cheers
James


signature.asc
Description: Digital signature
___
linux-snps-arc mailing list
linux-snps-arc@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-snps-arc

Re: [PATCH] bug.h: Work around GCC PR82365 in BUG()

2018-04-10 Thread James Hogan
Hi Arnd,

On Tue, Dec 19, 2017 at 12:39:33PM +0100, Arnd Bergmann wrote:
> diff --git a/include/linux/compiler-gcc.h b/include/linux/compiler-gcc.h
> index 5d595cfdb2c4..66cfdad68f7e 100644
> --- a/include/linux/compiler-gcc.h
> +++ b/include/linux/compiler-gcc.h
> @@ -205,6 +205,15 @@
>  #endif
>  
>  /*
> + * calling noreturn functions, __builtin_unreachable() and __builtin_trap()
> + * confuse the stack allocation in gcc, leading to overly large stack
> + * frames, see https://gcc.gnu.org/bugzilla/show_bug.cgi?id=82365
> + *
> + * Adding an empty inline assembly before it works around the problem
> + */
> +#define barrier_before_unreachable() asm volatile("")
> +
> +/*
>   * Mark a position in code as unreachable.  This can be used to
>   * suppress control flow warnings after asm blocks that transfer
>   * control elsewhere.
> @@ -214,7 +223,11 @@
>   * unreleased.  Really, we need to have autoconf for the kernel.
>   */
>  #define unreachable() \
> - do { annotate_unreachable(); __builtin_unreachable(); } while (0)
> + do {\
> + annotate_unreachable(); \
> + barrier_before_unreachable();   \
> + __builtin_unreachable();\
> + } while (0)

Unfortunately this breaks microMIPS builds (e.g. MIPS
micro32r2_defconfig and micro32r2el_defconfig) on gcc 7.2, due to the
lack of .insn in the asm volatile. Because of the
__builtin_unreachable() there is no code following it. Without the empty
asm the compiler will apparently put the .insn there automatically, but
with the empty asm it doesn't. Therefore the assembler won't treat an
immediately preceeding label as pointing at 16-bit microMIPS
instructions which need the ISA bit set, i.e. bit 0 of the address.
This causes assembler errors since the branch target is treated as a
different ISA mode:

arch/mips/mm/dma-default.s:3265: Error: branch to a symbol in another ISA mode
arch/mips/mm/dma-default.s:5027: Error: branch to a symbol in another ISA mode

Due to a compiler bug on gcc 4.9.2 -> somewhere before 7.2, Paul
submitted these patches a while back:
https://patchwork.linux-mips.org/patch/13360/
https://patchwork.linux-mips.org/patch/13361/

Your patch (suitably fixed for microMIPS) would I imagine fix that issue
too (it certainly fixes the resulting link error on microMIPS builds
with an old toolchain).

Before I forward port those patches to add .insn for MIPS, is that sort
of approach (an arch specific asm/compiler-gcc.h to allow MIPS to
override barrier_before_unreachable()) an acceptable fix?

Thanks
James


signature.asc
Description: Digital signature
___
linux-snps-arc mailing list
linux-snps-arc@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-snps-arc

Re: [PATCH] pci: Add and use PCI_GENERIC_SETUP Kconfig entry

2017-06-23 Thread James Hogan
On Fri, Jun 23, 2017 at 02:45:38PM -0700, Palmer Dabbelt wrote:
> diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig
> index 4c1a35f15838..86872246951c 100644
> --- a/arch/arm/Kconfig
> +++ b/arch/arm/Kconfig
> @@ -96,6 +96,7 @@ config ARM
>   select PERF_USE_VMALLOC
>   select RTC_LIB
>   select SYS_SUPPORTS_APM_EMULATION
> + select PCI_GENERIC_SETUP
>   # Above selects are sorted alphabetically; please add new ones
>   # according to that.  Thanks.

This comment seems to suggest PCI_GENERIC_SETUP should be added a few
lines up to preserve the alphabetical sorting.

> diff --git a/arch/arm64/Kconfig b/arch/arm64/Kconfig
> index b2024db225a9..6c684d8c8816 100644
> --- a/arch/arm64/Kconfig
> +++ b/arch/arm64/Kconfig
> @@ -115,6 +115,7 @@ config ARM64
>   select SPARSE_IRQ
>   select SYSCTL_EXCEPTION_TRACE
>   select THREAD_INFO_IN_TASK
> + select PCI_GENERIC_SETUP

Here too.

> diff --git a/arch/tile/Kconfig b/arch/tile/Kconfig
> index 4583c0320059..6679af85a882 100644
> --- a/arch/tile/Kconfig
> +++ b/arch/tile/Kconfig
> @@ -33,6 +33,7 @@ config TILE
>   select USER_STACKTRACE_SUPPORT
>   select USE_PMC if PERF_EVENTS
>   select VIRT_TO_BUS
> + select PCI_GENERIC_SETUP

and here

Otherwise
Reviewed-by: James Hogan 

Cheers
James


signature.asc
Description: Digital signature
___
linux-snps-arc mailing list
linux-snps-arc@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-snps-arc

Re: [PATCH 03/20] asm-generic: Drop getrlimit and setrlimit syscalls from default list

2017-06-19 Thread James Hogan
On Mon, Jun 19, 2017 at 11:58:41PM +0200, Arnd Bergmann wrote:
> On Mon, Jun 19, 2017 at 11:42 PM, James Hogan  wrote:
> > On Mon, Jun 19, 2017 at 06:49:46PM +0300, Yury Norov wrote:
> > Subject: [PATCH] Deprecate stat syscalls superseded by statx
> >
> > Various stat system calls can now be implemented as userland wrappers
> > around the new statx system call, so allow them to be removed from the
> > kernel by default for new architectures / ABIs.
> >
> > This involves adding __ARCH_WANT_SYSCALL_UNXSTAT to each existing
> > architecture, which enables the relevant stat system calls in the
> > generic system call list (if used). It also conditionally defines the
> > syscalls in fs/stat.c and struct stat / struct stat64 in
> > asm-generic/stat.h.
> >
> > Signed-off-by: James Hogan 
> > Cc: David Howells 
> > Cc: Alexander Viro 
> > Cc: Arnd Bergmann 
> > Cc: linux-fsde...@vger.kernel.org
> > Cc: linux-a...@vger.kernel.org
> > Cc: linux-...@vger.kernel.org
> > Cc: linux-ker...@vger.kernel.org
> 
> Good idea:
> 
> Acked-by:  Arnd Bergmann 

Thanks,

> 
> > +/* statx deprecates the un-extended stat syscalls which use struct 
> > stat[64] */
> > +#ifdef __ARCH_WANT_SYSCALL_UNXSTAT
> 
> I'm glad you explain what 'UNXSTAT' means here, since I would not
> have otherwise guessed it, but I also can't think of anything more
> intuitive.

Yeh, I renamed that several times while playing around with this :-).

The stat syscalls remind me a bit of the Vicar of Dibley episode where
the new road named "New Road" necessitates the renaming of the existing
"New Road" to "Quite Old Road" and "Quite Old Road" to "Really Quite Old
Road" and "Old Road" to "Very Old Road"!

Cheers
James


signature.asc
Description: Digital signature
___
linux-snps-arc mailing list
linux-snps-arc@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-snps-arc

Re: [PATCH 03/20] asm-generic: Drop getrlimit and setrlimit syscalls from default list

2017-06-19 Thread James Hogan
Hi Yury,

On Mon, Jun 19, 2017 at 06:49:46PM +0300, Yury Norov wrote:
> The newer prlimit64 syscall provides all the functionality provided by
> the getrlimit and setrlimit syscalls and adds the pid of target process,
> so future architectures won't need to include getrlimit and setrlimit.
> 
> Therefore drop getrlimit and setrlimit syscalls from the generic syscall
> list unless __ARCH_WANT_SET_GET_RLIMIT is defined by the architecture's
> unistd.h prior to including asm-generic/unistd.h, and adjust all architectures
> using the generic syscall list to define it so that no in-tree architectures
> are affected.

I have a similar experimental patch lying around for the stat system
calls which are superseded by statx (see below). If it looks acceptable
maybe you'd like to incorporate it (or something similar) into your
series.

Cheers
James

---
From: James Hogan 
Date: Fri, 2 Jun 2017 13:07:27 +0100
Subject: [PATCH] Deprecate stat syscalls superseded by statx

Various stat system calls can now be implemented as userland wrappers
around the new statx system call, so allow them to be removed from the
kernel by default for new architectures / ABIs.

This involves adding __ARCH_WANT_SYSCALL_UNXSTAT to each existing
architecture, which enables the relevant stat system calls in the
generic system call list (if used). It also conditionally defines the
syscalls in fs/stat.c and struct stat / struct stat64 in
asm-generic/stat.h.

Signed-off-by: James Hogan 
Cc: David Howells 
Cc: Alexander Viro 
Cc: Arnd Bergmann 
Cc: linux-fsde...@vger.kernel.org
Cc: linux-a...@vger.kernel.org
Cc: linux-...@vger.kernel.org
Cc: linux-ker...@vger.kernel.org
---
 arch/alpha/include/asm/unistd.h  | 1 +
 arch/arc/include/uapi/asm/unistd.h   | 1 +
 arch/arm/include/asm/unistd.h| 1 +
 arch/arm64/include/uapi/asm/unistd.h | 1 +
 arch/blackfin/include/asm/unistd.h   | 1 +
 arch/c6x/include/uapi/asm/unistd.h   | 1 +
 arch/cris/include/asm/unistd.h   | 1 +
 arch/frv/include/asm/unistd.h| 1 +
 arch/h8300/include/uapi/asm/unistd.h | 1 +
 arch/hexagon/include/uapi/asm/unistd.h   | 1 +
 arch/ia64/include/asm/unistd.h   | 2 ++
 arch/m32r/include/asm/unistd.h   | 1 +
 arch/m68k/include/asm/unistd.h   | 1 +
 arch/metag/include/uapi/asm/unistd.h | 1 +
 arch/microblaze/include/asm/unistd.h | 1 +
 arch/mips/include/asm/unistd.h   | 1 +
 arch/mn10300/include/asm/unistd.h| 1 +
 arch/nios2/include/uapi/asm/unistd.h | 1 +
 arch/openrisc/include/uapi/asm/unistd.h  | 1 +
 arch/parisc/include/asm/unistd.h | 1 +
 arch/powerpc/include/asm/unistd.h| 1 +
 arch/s390/include/asm/unistd.h   | 1 +
 arch/score/include/uapi/asm/unistd.h | 1 +
 arch/sh/include/asm/unistd.h | 1 +
 arch/sparc/include/asm/unistd.h  | 1 +
 arch/tile/include/uapi/asm/unistd.h  | 1 +
 arch/unicore32/include/uapi/asm/unistd.h | 1 +
 arch/x86/include/asm/unistd.h| 2 ++
 arch/xtensa/include/asm/unistd.h | 1 +
 fs/stat.c| 4 
 include/asm-generic/unistd.h | 2 ++
 include/uapi/asm-generic/stat.h  | 7 +++
 include/uapi/asm-generic/unistd.h| 6 ++
 scripts/checksyscalls.sh | 9 +
 34 files changed, 59 insertions(+)

diff --git a/arch/alpha/include/asm/unistd.h b/arch/alpha/include/asm/unistd.h
index a56e608db2f9..5ad9d35b1bfb 100644
--- a/arch/alpha/include/asm/unistd.h
+++ b/arch/alpha/include/asm/unistd.h
@@ -7,6 +7,7 @@
 
 #define __ARCH_WANT_OLD_READDIR
 #define __ARCH_WANT_STAT64
+#define __ARCH_WANT_SYSCALL_UNXSTAT
 #define __ARCH_WANT_SYS_GETHOSTNAME
 #define __ARCH_WANT_SYS_FADVISE64
 #define __ARCH_WANT_SYS_GETPGRP
diff --git a/arch/arc/include/uapi/asm/unistd.h 
b/arch/arc/include/uapi/asm/unistd.h
index ac6496527ad6..e68bdb8c6f58 100644
--- a/arch/arc/include/uapi/asm/unistd.h
+++ b/arch/arc/include/uapi/asm/unistd.h
@@ -17,6 +17,7 @@
 
 #define __ARCH_WANT_RENAMEAT
 #define __ARCH_WANT_SET_GET_RLIMIT
+#define __ARCH_WANT_SYSCALL_UNXSTAT
 #define __ARCH_WANT_SYS_EXECVE
 #define __ARCH_WANT_SYS_CLONE
 #define __ARCH_WANT_SYS_VFORK
diff --git a/arch/arm/include/asm/unistd.h b/arch/arm/include/asm/unistd.h
index 076090d2dbf5..68bc0b5e58a4 100644
--- a/arch/arm/include/asm/unistd.h
+++ b/arch/arm/include/asm/unistd.h
@@ -17,6 +17,7 @@
 #include 
 
 #define __ARCH_WANT_STAT64
+#define __ARCH_WANT_SYSCALL_UNXSTAT
 #define __ARCH_WANT_SYS_GETHOSTNAME
 #define __ARCH_WANT_SYS_PAUSE
 #define __ARCH_WANT_SYS_GETPGRP
diff --git a/arch/arm64/include/uapi/asm/unistd.h 
b/arch/arm64/include/uapi/asm/unistd.h
index 48355a683e25..d066041b53e7 100644
--- a/arch/arm64/include/uapi/asm/unistd.h
+++ b/arch/arm64/include/uapi/asm/unistd.h
@@ -16,5 +16,6 @@
 
 #define __ARCH_WANT_RENAMEAT
 #define __ARCH_WANT_SET_GET_RLIMIT
+#define __ARCH_WANT_SYSCALL_UNXSTAT
 
 #include 
diff --git a/arch/blac

Re: [PATCH 03/20] asm-generic: Drop getrlimit and setrlimit syscalls from default list

2017-06-05 Thread James Hogan
Hi Yury,

On Sun, Jun 04, 2017 at 02:59:52PM +0300, Yury Norov wrote:
> The newer prlimit64 syscall provides all the functionality provided by
> the getrlimit and setrlimit syscalls and adds the pid of target process,
> so future architectures won't need to include getrlimit and setrlimit.
> 
> Therefore drop getrlimit and setrlimit syscalls from the generic syscall
> list unless __ARCH_WANT_SET_GET_RLIMIT is defined by the architecture's
> unistd.h prior to including asm-generic/unistd.h, and adjust all architectures
> using the generic syscall list to define it so that no in-tree architectures
> are affected.
> 
> Cc: Arnd Bergmann 
> Cc: James Hogan 
> Cc: linux-a...@vger.kernel.org
> Cc: linux-snps-arc@lists.infradead.org
> Cc: Catalin Marinas 
> Cc: Will Deacon 
> Cc: linux-arm-ker...@lists.infradead.org
> Cc: Mark Salter 
> Cc: Aurelien Jacquiot 
> Cc: linux-c6x-...@linux-c6x.org
> Cc: Richard Kuo 
> Cc: linux-hexa...@vger.kernel.org
> Cc: linux-me...@vger.kernel.org
> Cc: Jonas Bonn 
> Cc: li...@lists.openrisc.net
> Cc: Chen Liqin 
> Cc: Lennox Wu 
> Cc: Chris Metcalf 
> Cc: Guan Xuetao 
> Cc: Ley Foon Tan 
> Cc: nios2-...@lists.rocketboards.org
> Cc: Yoshinori Sato 
> Cc: uclinux-h8-de...@lists.sourceforge.jp
> Signed-off-by: Yury Norov 
> Acked-by: Arnd Bergmann 
> Acked-by: Mark Salter  [c6x]
> Acked-by: James Hogan  [metag]
> Acked-by: Ley Foon Tan  [nios2]
> Acked-by: Stafford Horne  [openrisc]
> Acked-by: Will Deacon  [arm64]
> Acked-by: Vineet Gupta  #arch/arc bits
> ---
>  arch/arc/include/uapi/asm/unistd.h   | 1 +
>  arch/arm64/include/uapi/asm/unistd.h | 1 +
>  arch/c6x/include/uapi/asm/unistd.h   | 1 +
>  arch/h8300/include/uapi/asm/unistd.h | 1 +
>  arch/hexagon/include/uapi/asm/unistd.h   | 1 +
>  arch/metag/include/uapi/asm/unistd.h | 1 +
>  arch/nios2/include/uapi/asm/unistd.h | 1 +
>  arch/openrisc/include/uapi/asm/unistd.h  | 1 +
>  arch/score/include/uapi/asm/unistd.h | 1 +
>  arch/tile/include/uapi/asm/unistd.h  | 1 +
>  arch/unicore32/include/uapi/asm/unistd.h | 1 +
>  include/uapi/asm-generic/unistd.h| 5 +

Don't forget to add __IGNORE_getrlimit and __IGNORE_setrlimit to
scripts/checksyscalls.sh, or you'll get warnings about missing syscalls.

Cheers
James


signature.asc
Description: Digital signature
___
linux-snps-arc mailing list
linux-snps-arc@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-snps-arc

Re: [PATCH] asm-generic: Drop getrlimit and setrlimit syscalls from default list

2016-10-29 Thread James Hogan
On 29 October 2016 22:45:41 BST, Yury Norov  wrote:
>On Sat, Oct 29, 2016 at 11:02:40PM +0200, Arnd Bergmann wrote:
>> On Saturday, October 22, 2016 3:14:04 PM CEST Yury Norov wrote:
>> > The newer prlimit64 syscall provides all the functionality provided
>by
>> > the getrlimit and setrlimit syscalls and adds the pid of target
>process,
>> > so future architectures won't need to include getrlimit and
>setrlimit.
>> > 
>> > Therefore drop getrlimit and setrlimit syscalls from the generic
>syscall
>> > list unless __ARCH_WANT_SET_GET_RLIMIT is defined by the
>architecture's
>> > unistd.h prior to including asm-generic/unistd.h, and adjust all
>> > architectures using the generic syscall list to define it so that
>no
>> > in-tree architectures are affected.
>> 
>> The patch looks good, but shouldn't we also hide the actual syscall
>> implementation if the symbol is not set? It's just dead code
>otherwise
>> for new architectures.
>
>I was thinking on it. The patch of James Hogan, b0da6d4415
>(asm-generic:
>Drop renameat syscall from default list) doesn't do it for renameat(),
>so
>I decided not to do it too. It's not so easy to disable syscalls
>because arch
>may support few ABIs, and some of them may require the syscall. For
>example,
>arm64 supports lp64, aarch32 and ilp32, and first two ABIs need
>renameat()
>and getrlimit/setrlimit.
>
>At now there's no arches that doesn't need renameat() and
>getrlimit/setrlimit,
>and there will be no such arch in nearest future. So there will be no
>dead code.
>
>But I agree with you that we need make that implementations 
>conditional. If I understand it correctly, we need something like
>__ARCH_WANT_SET_GET_RLIMIT in all existing Kconfigs, correct?
>
>I think this patch may be applied as is, and if needed I can send
>another patch that disables renameat() and getrlimit/setrlimit soon.
>
>James, what do you think?

For renameat my main concern was the ABI, and I didn't think it was worth the 
effort or slightly increased complexity to ifdef the implementation since it 
was such a trivial wrapper around renameat2. Getrlimit and setrlimit aren't 
much more complex, just a user copy in addition to the standard doprlimit, so i 
probably wouldn't have bothered for them either.

cheers
James Hogan

___
linux-snps-arc mailing list
linux-snps-arc@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-snps-arc


Re: [PATCH] asm-generic: Drop getrlimit and setrlimit syscalls from default list

2016-10-24 Thread James Hogan
On Sat, Oct 22, 2016 at 03:14:04PM +0300, Yury Norov wrote:
> The newer prlimit64 syscall provides all the functionality provided by
> the getrlimit and setrlimit syscalls and adds the pid of target process,
> so future architectures won't need to include getrlimit and setrlimit.
> 
> Therefore drop getrlimit and setrlimit syscalls from the generic syscall
> list unless __ARCH_WANT_SET_GET_RLIMIT is defined by the architecture's
> unistd.h prior to including asm-generic/unistd.h, and adjust all
> architectures using the generic syscall list to define it so that no
> in-tree architectures are affected.
> 
> Cc: Vineet Gupta 
> Cc: Catalin Marinas 
> Cc: Will Deacon 
> Cc: Mark Salter 
> Cc: Aurelien Jacquiot 
> Cc: Yoshinori Sato 
> Cc: Richard Kuo 
> Cc: James Hogan 
> Cc: Ley Foon Tan 
> Cc: Jonas Bonn 
> Cc: Chen Liqin 
> Cc: Lennox Wu 
> Cc: Chris Metcalf 
> Cc: Guan Xuetao 
> Cc: Arnd Bergmann 
> Cc: Andrew Pinski 
> Cc: linux-snps-arc@lists.infradead.org
> Cc: linux-ker...@vger.kernel.org
> Cc: linux-arm-ker...@lists.infradead.org
> Cc: linux-c6x-...@linux-c6x.org
> Cc: uclinux-h8-de...@lists.sourceforge.jp
> Cc: linux-hexa...@vger.kernel.org
> Cc: linux-me...@vger.kernel.org
> Cc: nios2-...@lists.rocketboards.org
> Cc: linux-a...@vger.kernel.or
> Signed-off-by: Yury Norov 
> 
> ---
>  arch/arc/include/uapi/asm/unistd.h   | 1 +
>  arch/arm64/include/uapi/asm/unistd.h | 1 +
>  arch/c6x/include/uapi/asm/unistd.h   | 1 +
>  arch/h8300/include/uapi/asm/unistd.h | 1 +
>  arch/hexagon/include/uapi/asm/unistd.h   | 1 +
>  arch/metag/include/uapi/asm/unistd.h | 1 +

Acked-by: James Hogan  [metag]

Cheers
James

>  arch/nios2/include/uapi/asm/unistd.h | 1 +
>  arch/openrisc/include/uapi/asm/unistd.h  | 1 +
>  arch/score/include/uapi/asm/unistd.h | 1 +
>  arch/tile/include/uapi/asm/unistd.h  | 1 +
>  arch/unicore32/include/uapi/asm/unistd.h | 1 +
>  include/uapi/asm-generic/unistd.h| 5 +
>  12 files changed, 16 insertions(+)
> 
> diff --git a/arch/arc/include/uapi/asm/unistd.h 
> b/arch/arc/include/uapi/asm/unistd.h
> index 41fa2ec..928546d 100644
> --- a/arch/arc/include/uapi/asm/unistd.h
> +++ b/arch/arc/include/uapi/asm/unistd.h
> @@ -16,6 +16,7 @@
>  #define _UAPI_ASM_ARC_UNISTD_H
>  
>  #define __ARCH_WANT_RENAMEAT
> +#define __ARCH_WANT_SET_GET_RLIMIT
>  #define __ARCH_WANT_SYS_EXECVE
>  #define __ARCH_WANT_SYS_CLONE
>  #define __ARCH_WANT_SYS_VFORK
> diff --git a/arch/arm64/include/uapi/asm/unistd.h 
> b/arch/arm64/include/uapi/asm/unistd.h
> index 043d17a..48355a6 100644
> --- a/arch/arm64/include/uapi/asm/unistd.h
> +++ b/arch/arm64/include/uapi/asm/unistd.h
> @@ -15,5 +15,6 @@
>   */
>  
>  #define __ARCH_WANT_RENAMEAT
> +#define __ARCH_WANT_SET_GET_RLIMIT
>  
>  #include 
> diff --git a/arch/c6x/include/uapi/asm/unistd.h 
> b/arch/c6x/include/uapi/asm/unistd.h
> index 12d73d9..f676231 100644
> --- a/arch/c6x/include/uapi/asm/unistd.h
> +++ b/arch/c6x/include/uapi/asm/unistd.h
> @@ -15,6 +15,7 @@
>   */
>  
>  #define __ARCH_WANT_RENAMEAT
> +#define __ARCH_WANT_SET_GET_RLIMIT
>  #define __ARCH_WANT_SYS_CLONE
>  
>  /* Use the standard ABI for syscalls. */
> diff --git a/arch/h8300/include/uapi/asm/unistd.h 
> b/arch/h8300/include/uapi/asm/unistd.h
> index 7dd20ef..2f98394 100644
> --- a/arch/h8300/include/uapi/asm/unistd.h
> +++ b/arch/h8300/include/uapi/asm/unistd.h
> @@ -1,5 +1,6 @@
>  #define __ARCH_NOMMU
>  
>  #define __ARCH_WANT_RENAMEAT
> +#define __ARCH_WANT_SET_GET_RLIMIT
>  
>  #include 
> diff --git a/arch/hexagon/include/uapi/asm/unistd.h 
> b/arch/hexagon/include/uapi/asm/unistd.h
> index 2151760..52d585c 100644
> --- a/arch/hexagon/include/uapi/asm/unistd.h
> +++ b/arch/hexagon/include/uapi/asm/unistd.h
> @@ -28,6 +28,7 @@
>  
>  #define sys_mmap2 sys_mmap_pgoff
>  #define __ARCH_WANT_RENAMEAT
> +#define __ARCH_WANT_SET_GET_RLIMIT
>  #define __ARCH_WANT_SYS_EXECVE
>  #define __ARCH_WANT_SYS_CLONE
>  #define __ARCH_WANT_SYS_VFORK
> diff --git a/arch/metag/include/uapi/asm/unistd.h 
> b/arch/metag/include/uapi/asm/unistd.h
> index 459b6ec..16b5cb3 100644
> --- a/arch/metag/include/uapi/asm/unistd.h
> +++ b/arch/metag/include/uapi/asm/unistd.h
> @@ -8,6 +8,7 @@
>   */
>  
>  #define __ARCH_WANT_RENAMEAT
> +#define __ARCH_WANT_SET_GET_RLIMIT
>  
>  /* Use the standard ABI for syscalls. */
>  #include 
> diff --git a/arch/nios2/include/uapi/asm/unistd.h 
> b/arch/nios2/include/uapi/asm/unistd.h
> index 51a32c7..b0dda4d 100644
> --- a/arch/nios2/include/uapi/asm/unistd.h
> +++ b/arch/nios2/include/uapi/asm/unistd.h
> @@ -18,6 +18,7 @@
>

[PATCH v2] asm-generic: Drop renameat syscall from default list

2016-04-29 Thread James Hogan
The newer renameat2 syscall provides all the functionality provided by
the renameat syscall and adds flags, so future architectures won't need
to include renameat.

Therefore drop the renameat syscall from the generic syscall list unless
__ARCH_WANT_RENAMEAT is defined by the architecture's unistd.h prior to
including asm-generic/unistd.h, and adjust all architectures using the
generic syscall list to define it so that no in-tree architectures are
affected.

Signed-off-by: James Hogan 
Cc: Arnd Bergmann 
Cc: linux-a...@vger.kernel.org
Cc: Vineet Gupta 
Cc: linux-snps-arc@lists.infradead.org
Cc: Catalin Marinas 
Cc: Will Deacon 
Cc: linux-arm-ker...@lists.infradead.org
Cc: Mark Salter 
Cc: Aurelien Jacquiot 
Cc: linux-c6x-...@linux-c6x.org
Cc: Richard Kuo 
Cc: linux-hexa...@vger.kernel.org
Cc: linux-me...@vger.kernel.org
Cc: Jonas Bonn 
Cc: li...@lists.openrisc.net
Cc: Chen Liqin 
Cc: Lennox Wu 
Cc: Chris Metcalf 
Cc: Guan Xuetao 
Cc: Ley Foon Tan 
Cc: nios2-...@lists.rocketboards.org
Cc: Yoshinori Sato 
Cc: uclinux-h8-de...@lists.sourceforge.jp
---
I just found this patch on an old branch, it appears to have slipped
through the cracks. Time for a respon.

Changes in v2:
- Rebase onto v4.6-rc5.
- Add __ARCH_WANT_RENAMEAT to h8300 and nios2 arches too.
---
 arch/arc/include/uapi/asm/unistd.h   | 1 +
 arch/arm64/include/uapi/asm/unistd.h | 3 +++
 arch/c6x/include/uapi/asm/unistd.h   | 1 +
 arch/h8300/include/uapi/asm/unistd.h | 2 ++
 arch/hexagon/include/uapi/asm/unistd.h   | 1 +
 arch/metag/include/uapi/asm/unistd.h | 2 ++
 arch/nios2/include/uapi/asm/unistd.h | 2 ++
 arch/openrisc/include/uapi/asm/unistd.h  | 1 +
 arch/score/include/uapi/asm/unistd.h | 1 +
 arch/tile/include/uapi/asm/unistd.h  | 1 +
 arch/unicore32/include/uapi/asm/unistd.h | 2 ++
 include/uapi/asm-generic/unistd.h| 3 +++
 12 files changed, 20 insertions(+)

diff --git a/arch/arc/include/uapi/asm/unistd.h 
b/arch/arc/include/uapi/asm/unistd.h
index 39e58d1cdf90..41fa2ec9e02c 100644
--- a/arch/arc/include/uapi/asm/unistd.h
+++ b/arch/arc/include/uapi/asm/unistd.h
@@ -15,6 +15,7 @@
 #if !defined(_UAPI_ASM_ARC_UNISTD_H) || defined(__SYSCALL)
 #define _UAPI_ASM_ARC_UNISTD_H
 
+#define __ARCH_WANT_RENAMEAT
 #define __ARCH_WANT_SYS_EXECVE
 #define __ARCH_WANT_SYS_CLONE
 #define __ARCH_WANT_SYS_VFORK
diff --git a/arch/arm64/include/uapi/asm/unistd.h 
b/arch/arm64/include/uapi/asm/unistd.h
index 1caadc24e3fe..043d17a21342 100644
--- a/arch/arm64/include/uapi/asm/unistd.h
+++ b/arch/arm64/include/uapi/asm/unistd.h
@@ -13,4 +13,7 @@
  * You should have received a copy of the GNU General Public License
  * along with this program.  If not, see <http://www.gnu.org/licenses/>.
  */
+
+#define __ARCH_WANT_RENAMEAT
+
 #include 
diff --git a/arch/c6x/include/uapi/asm/unistd.h 
b/arch/c6x/include/uapi/asm/unistd.h
index e7d09a614d10..12d73d9d81f5 100644
--- a/arch/c6x/include/uapi/asm/unistd.h
+++ b/arch/c6x/include/uapi/asm/unistd.h
@@ -14,6 +14,7 @@
  *   more details.
  */
 
+#define __ARCH_WANT_RENAMEAT
 #define __ARCH_WANT_SYS_CLONE
 
 /* Use the standard ABI for syscalls. */
diff --git a/arch/h8300/include/uapi/asm/unistd.h 
b/arch/h8300/include/uapi/asm/unistd.h
index 7a2eb698def3..7dd20ef7625a 100644
--- a/arch/h8300/include/uapi/asm/unistd.h
+++ b/arch/h8300/include/uapi/asm/unistd.h
@@ -1,3 +1,5 @@
 #define __ARCH_NOMMU
 
+#define __ARCH_WANT_RENAMEAT
+
 #include 
diff --git a/arch/hexagon/include/uapi/asm/unistd.h 
b/arch/hexagon/include/uapi/asm/unistd.h
index ffee405d6803..21517600432b 100644
--- a/arch/hexagon/include/uapi/asm/unistd.h
+++ b/arch/hexagon/include/uapi/asm/unistd.h
@@ -27,6 +27,7 @@
  */
 
 #define sys_mmap2 sys_mmap_pgoff
+#define __ARCH_WANT_RENAMEAT
 #define __ARCH_WANT_SYS_EXECVE
 #define __ARCH_WANT_SYS_CLONE
 #define __ARCH_WANT_SYS_VFORK
diff --git a/arch/metag/include/uapi/asm/unistd.h 
b/arch/metag/include/uapi/asm/unistd.h
index b80b8e899d22..459b6ec15848 100644
--- a/arch/metag/include/uapi/asm/unistd.h
+++ b/arch/metag/include/uapi/asm/unistd.h
@@ -7,6 +7,8 @@
  * (at your option) any later version.
  */
 
+#define __ARCH_WANT_RENAMEAT
+
 /* Use the standard ABI for syscalls. */
 #include 
 
diff --git a/arch/nios2/include/uapi/asm/unistd.h 
b/arch/nios2/include/uapi/asm/unistd.h
index c4bf79510461..51a32c71ce2b 100644
--- a/arch/nios2/include/uapi/asm/unistd.h
+++ b/arch/nios2/include/uapi/asm/unistd.h
@@ -17,6 +17,8 @@
 
  #define sys_mmap2 sys_mmap_pgoff
 
+#define __ARCH_WANT_RENAMEAT
+
 /* Use the standard ABI for syscalls */
 #include 
 
diff --git a/arch/openrisc/include/uapi/asm/unistd.h 
b/arch/openrisc/include/uapi/asm/unistd.h
index ce40b71df006..471905bd7745 100644
--- a/arch/openrisc/include/uapi/asm/unistd.h
+++ b/arch/openrisc/include/uapi/asm/unistd.h
@@ -20,6 +20,7 @@
 
 #define sys_mmap2 sys_mmap_pgoff
 
+#define __ARCH_WANT_RENAMEAT
 #define __ARCH_WANT_SYS_FORK
 #define __ARCH_WANT_SYS_CLONE
 
diff --git a/arch/score/include/uapi/asm/unistd