History log of /linux-master/arch/sparc/include/uapi/asm/unistd.h
Revision Date Author Comments
# 36800330 13-Nov-2018 Firoz Khan <firoz.khan@linaro.org>

sparc: generate uapi header and system call table files

System call table generation script must be run to gener-
ate unistd_32/64.h and syscall_table_32/64/c32.h files.
This patch will have changes which will invokes the script.

This patch will generate unistd_32/64.h and syscall_table-
_32/64/c32.h files by the syscall table generation script
invoked by parisc/Makefile and the generated files against
the removed files must be identical.

The generated uapi header file will be included in uapi/-
asm/unistd.h and generated system call table header file
will be included by kernel/systbls_32/64.S file.

Signed-off-by: Firoz Khan <firoz.khan@linaro.org>
Signed-off-by: David S. Miller <davem@davemloft.net>


# 61257f56 13-Nov-2018 Firoz Khan <firoz.khan@linaro.org>

sparc: add __NR_syscalls along with NR_syscalls

NR_syscalls macro holds the number of system call exist
in sparc architecture. We have to change the value of NR-
_syscalls, if we add or delete a system call.

One of the patch in this patch series has a script which
will generate a uapi header based on syscall.tbl file.
The syscall.tbl file contains the total number of system
calls information. So we have two option to update NR_sy-
scalls value.

1. Update NR_syscalls in asm/unistd.h manually by count-
ing the no.of system calls. No need to update NR_sys-
calls until we either add a new system call or delete
existing system call.

2. We can keep this feature it above mentioned script,
that will count the number of syscalls and keep it in
a generated file. In this case we don't need to expli-
citly update NR_syscalls in asm/unistd.h file.

The 2nd option will be the recommended one. For that, I
added the __NR_syscalls macro in uapi/asm/unistd.h along
with NR_syscalls asm/unistd.h. The macro __NR_syscalls
also added for making the name convention same across all
architecture. While __NR_syscalls isn't strictly part of
the uapi, having it as part of the generated header to
simplifies the implementation. We also need to enclose
this macro with #ifdef __KERNEL__ to avoid side effects.

Signed-off-by: Firoz Khan <firoz.khan@linaro.org>
Signed-off-by: David S. Miller <davem@davemloft.net>


# d441f93d 13-Nov-2018 Firoz Khan <firoz.khan@linaro.org>

sparc: move __IGNORE* entries to non uapi header

All the __IGNORE* entries are resides in the uapi header
file move to non uapi header asm/unistd.h as it is not
used by any user space applications.

It is correct to keep __IGNORE* entry in non uapi header
asm/unistd.h while uapi/asm/unistd.h must hold information
only useful for user space applications.

One of the patch in this patch series will generate uapi
header file. The information which directly used by the
user space application must be present in uapi file.

Signed-off-by: Firoz Khan <firoz.khan@linaro.org>
Signed-off-by: David S. Miller <davem@davemloft.net>


# 7c26701a 09-Oct-2018 David S. Miller <davem@davemloft.net>

sparc: Wire up io_pgetevents system call.

Signed-off-by: David S. Miller <davem@davemloft.net>


# 6f52b16c 01-Nov-2017 Greg Kroah-Hartman <gregkh@linuxfoundation.org>

License cleanup: add SPDX license identifier to uapi header files with no license

Many user space API headers are missing licensing information, which
makes it hard for compliance tools to determine the correct license.

By default are files without license information under the default
license of the kernel, which is GPLV2. Marking them GPLV2 would exclude
them from being included in non GPLV2 code, which is obviously not
intended. The user space API headers fall under the syscall exception
which is in the kernels COPYING file:

NOTE! This copyright does *not* cover user programs that use kernel
services by normal system calls - this is merely considered normal use
of the kernel, and does *not* fall under the heading of "derived work".

otherwise syscall usage would not be possible.

Update the files which contain no license information with an SPDX
license identifier. The chosen identifier is 'GPL-2.0 WITH
Linux-syscall-note' which is the officially assigned identifier for the
Linux syscall exception. SPDX license identifiers are a legally binding
shorthand, which can be used instead of the full boiler plate text.

This patch is based on work done by Thomas Gleixner and Kate Stewart and
Philippe Ombredanne. See the previous patch in this series for the
methodology of how this patch was researched.

Reviewed-by: Kate Stewart <kstewart@linuxfoundation.org>
Reviewed-by: Philippe Ombredanne <pombredanne@nexb.com>
Reviewed-by: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# f6ebf0bb 23-Apr-2017 David S. Miller <davem@davemloft.net>

sparc: Update syscall tables.

Hook up statx.

Ignore pkeys system calls, we don't have protection keeys
on SPARC.

Signed-off-by: David S. Miller <davem@davemloft.net>


# 5ec71293 29-Mar-2016 David S. Miller <davem@davemloft.net>

sparc: Write up preadv2/pwritev2 syscalls.

Signed-off-by: David S. Miller <davem@davemloft.net>


# c10910c3 21-Jan-2016 David S. Miller <davem@davemloft.net>

sparc: Hook up copy_file_range syscall.

Signed-off-by: David S. Miller <davem@davemloft.net>


# 42d85c52 31-Dec-2015 David S. Miller <davem@davemloft.net>

sparc: Wire up mlock2 system call.

Signed-off-by: David S. Miller <davem@davemloft.net>


# 8b30ca73 31-Dec-2015 David S. Miller <davem@davemloft.net>

sparc: Add all necessary direct socket system calls.

The GLIBC folks would like to eliminate socketcall support
eventually, and this makes sense regardless so wire them
all up.

Signed-off-by: David S. Miller <davem@davemloft.net>


# 9bcfd78a 20-Nov-2015 Mike Kravetz <mike.kravetz@oracle.com>

sparc: Hook up userfaultfd system call

After hooking up system call, userfaultfd selftest was successful for
both 32 and 64 bit version of test.

Signed-off-by: Mike Kravetz <mike.kravetz@oracle.com>
Signed-off-by: David S. Miller <davem@davemloft.net>


# 9c2d5eeb 09-Nov-2015 Mathieu Desnoyers <mathieu.desnoyers@efficios.com>

sparc/sparc64: allocate sys_membarrier system call number

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Acked-by: "David S. Miller" <davem@davemloft.net>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>


# 38351a32 12-Dec-2014 David Drysdale <drysdale@google.com>

sparc: hook up execveat system call

Signed-off-by: David Drysdale <drysdale@google.com>
Acked-by: David S. Miller <davem@davemloft.net>
Cc: Stephen Rothwell <sfr@canb.auug.org.au>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>


# c20ce793 28-Oct-2014 David S. Miller <davem@davemloft.net>

sparc: Hook up bpf system call.

Signed-off-by: David S. Miller <davem@davemloft.net>


# 10cf15e1 13-Aug-2014 David S. Miller <davem@davemloft.net>

sparc: Hook up memfd_create system call.

Signed-off-by: David S. Miller <davem@davemloft.net>


# caa9199b 06-Aug-2014 David S. Miller <davem@davemloft.net>

sparc: Hook up seccomp and getrandom system calls.

Signed-off-by: David S. Miller <davem@davemloft.net>


# 26053926 21-Jul-2014 David S. Miller <davem@davemloft.net>

sparc: Hook up renameat2 syscall.

Signed-off-by: David S. Miller <davem@davemloft.net>


# a54983ae 29-Jan-2014 David S. Miller <davem@davemloft.net>

sparc: Hook up sched_setattr and sched_getattr syscalls.

Signed-off-by: David S. Miller <davem@davemloft.net>


# 4e4d78f1 28-Dec-2012 David S. Miller <davem@davemloft.net>

sparc: Hook up finit_module syscall.

Signed-off-by: David S. Miller <davem@davemloft.net>


# 1df35f80 28-Oct-2012 David S. Miller <davem@davemloft.net>

sparc: Wire up sys_kcmp.

Signed-off-by: David S. Miller <davem@davemloft.net>


# 517ffce4 26-Oct-2012 David S. Miller <davem@davemloft.net>

sparc64: Make montmul/montsqr/mpmul usable in 32-bit threads.

The Montgomery Multiply, Montgomery Square, and Multiple-Precision
Multiply instructions work by loading a combination of the floating
point and multiple register windows worth of integer registers
with the inputs.

These values are 64-bit. But for 32-bit userland processes we only
save the low 32-bits of each integer register during a register spill.
This is because the register window save area is in the user stack and
has a fixed layout.

Therefore, the only way to use these instruction in 32-bit mode is to
perform the following sequence:

1) Load the top-32bits of a choosen integer register with a sentinel,
say "-1". This will be in the outer-most register window.

The idea is that we're trying to see if the outer-most register
window gets spilled, and thus the 64-bit values were truncated.

2) Load all the inputs for the montmul/montsqr/mpmul instruction,
down to the inner-most register window.

3) Execute the opcode.

4) Traverse back up to the outer-most register window.

5) Check the sentinel, if it's still "-1" store the results.
Otherwise retry the entire sequence.

This retry is extremely troublesome. If you're just unlucky and an
interrupt or other trap happens, it'll push that outer-most window to
the stack and clear the sentinel when we restore it.

We could retry forever and never make forward progress if interrupts
arrive at a fast enough rate (consider perf events as one example).
So we have do limited retries and fallback to software which is
extremely non-deterministic.

Luckily it's very straightforward to provide a mechanism to let
32-bit applications use a 64-bit stack. Stacks in 64-bit mode are
biased by 2047 bytes, which means that the lowest bit is set in the
actual %sp register value.

So if we see bit zero set in a 32-bit application's stack we treat
it like a 64-bit stack.

Runtime detection of such a facility is tricky, and cumbersome at
best. For example, just trying to use a biased stack and seeing if it
works is hard to recover from (the signal handler will need to use an
alt stack, plus something along the lines of longjmp). Therefore, we
add a system call to report a bitmask of arch specific features like
this in a cheap and less hairy way.

With help from Andy Polyakov.

Signed-off-by: David S. Miller <davem@davemloft.net>


# 54579826 09-Oct-2012 David Howells <dhowells@redhat.com>

UAPI: (Scripted) Disintegrate arch/sparc/include/asm

Signed-off-by: David Howells <dhowells@redhat.com>
Acked-by: Arnd Bergmann <arnd@arndb.de>
Acked-by: Thomas Gleixner <tglx@linutronix.de>
Acked-by: Michael Kerrisk <mtk.manpages@gmail.com>
Acked-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
Acked-by: Dave Jones <davej@redhat.com>