The test helps to validate clamping and mount behaviors
according to supported file system timestamp ranges.
Note that the test can fail on 32-bit systems for a
few file systems. This will be corrected when vfs is
transitioned to use 64-bit timestamps.
Signed-off-by: Deepa Dinamani <deepa.kernel(a)gmail.com>
---
The branch of the kernel tree can be located at
https://github.com/deepa-hub/vfs refs/heads/vfs_timestamp_policy
The xfs_io patch to add utimes is at
https://www.spinics.net/lists/linux-xfs/msg02952.html
Changes since v2:
* Refactored notrun handling
* Updated comments
Changes since v1:
* Use xfs_io utimes command
* Updated error handling
* Reorganized code according to review comments
common/rc | 48 +++++++++++++
tests/generic/390 | 192 ++++++++++++++++++++++++++++++++++++++++++++++++++
tests/generic/390.out | 2 +
tests/generic/group | 1 +
4 files changed, 243 insertions(+)
create mode 100755 tests/generic/390
create mode 100644 tests/generic/390.out
diff --git a/common/rc b/common/rc
index e3b54ec..17f025e 100644
--- a/common/rc
+++ b/common/rc
@@ -1960,6 +1960,51 @@ _run_aiodio()
return $status
}
+# this test requires y2038 sysfs switch and filesystem
+# timestamp ranges support.
+_require_y2038()
+{
+ local device=${1:-$TEST_DEV}
+ local sysfsdir=/proc/sys/fs/fs-timestamp-check-on
+
+ if [ ! -e $sysfsdir ]; then
+ _notrun "no kernel support for y2038 sysfs switch"
+ fi
+
+ local tsmin tsmax
+ read tsmin tsmax <<<$(_filesystem_timestamp_range $device)
+ if [ $tsmin -eq -1 -a $tsmax -eq -1 ]; then
+ _notrun "filesystem $FSTYP timestamp bounds are unknown"
+ fi
+}
+
+_filesystem_timestamp_range()
+{
+ device=${1:-$TEST_DEV}
+ case $FSTYP in
+ ext4)
+ if [ $(dumpe2fs -h $device 2>/dev/null | grep "Inode size:" | cut -d: -f2) -gt 128 ]; then
+ echo "-2147483648 15032385535"
+ else
+ echo "-2147483648 2147483647"
+ fi
+ ;;
+
+ xfs)
+ echo "-2147483648 2147483647"
+ ;;
+ jfs)
+ echo "0 4294967295"
+ ;;
+ f2fs)
+ echo "-2147483648 2147483647"
+ ;;
+ *)
+ echo "-1 -1"
+ ;;
+ esac
+}
+
# indicate whether YP/NIS is active or not
#
_yp_active()
@@ -2070,6 +2115,9 @@ _require_xfs_io_command()
echo $testio | egrep -q "Inappropriate ioctl" && \
_notrun "xfs_io $command support is missing"
;;
+ "utimes" )
+ testio=`$XFS_IO_PROG -f -c "utimes" 0 0 0 0 $testfile 2>&1`
+ ;;
*)
testio=`$XFS_IO_PROG -c "$command help" 2>&1`
esac
diff --git a/tests/generic/390 b/tests/generic/390
new file mode 100755
index 0000000..f68b931
--- /dev/null
+++ b/tests/generic/390
@@ -0,0 +1,192 @@
+#! /bin/bash
+# FS QA Test 390
+#
+# Tests to verify policy for filesystem timestamps for
+# supported ranges:
+# 1. Verify filesystem rw mount according to sysctl
+# timestamp_supported.
+# 2. Verify timestamp clamping for timestamps beyond max
+# timestamp supported.
+#
+# Exit status 1: either or both tests above fail.
+# Exit status 0: both the above tests pass.
+#
+#-----------------------------------------------------------------------
+# Copyright (c) 2016 Deepa Dinamani. All Rights Reserved.
+#
+# This program is free software; you can redistribute it and/or
+# modify it under the terms of the GNU General Public License as
+# published by the Free Software Foundation.
+#
+# This program is distributed in the hope that it would be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write the Free Software Foundation,
+# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+#-----------------------------------------------------------------------
+#
+
+seq=`basename $0`
+seqres=$RESULT_DIR/$seq
+echo "QA output created by $seq"
+
+here=`pwd`
+tmp=/tmp/$$
+status=1 # failure is the default!
+trap "exit \$status" 0 1 2 3 15
+
+# Get standard environment, filters and checks.
+. ./common/rc
+. ./common/filter
+. ./common/attr
+
+# remove previous $seqres.full before test
+rm -f $seqres.full
+
+# Prerequisites for the test run.
+_supported_fs generic
+_supported_os Linux
+_require_scratch
+_require_xfs_io_command utimes
+
+# Compare file timestamps obtained from stat
+# with a given timestamp.
+check_stat()
+{
+ file=$1
+ timestamp=$2
+
+ stat_timestamp=`stat -c"%X;%Y" $file`
+
+ prev_timestamp="$timestamp;$timestamp"
+ if [ $prev_timestamp != $stat_timestamp ]; then
+ echo "$prev_timestamp != $stat_timestamp" | tee -a $seqres.full
+ fi
+}
+
+run_test_individual()
+{
+ file=$1
+ timestamp=$2
+ update_time=$3
+
+ #check if the time needs update
+ if [ $update_time -eq 1 ]; then
+ echo "Updating file: $file to timestamp `date -d @$timestamp`" >> $seqres.full
+ $XFS_IO_PROG -f -c "utimes $timestamp 0 $timestamp 0" $file
+ if [ $? -ne 0 ]; then
+ echo "Failed to update times on $file" | tee -a $seqres.full
+ fi
+ fi
+
+ tsclamp=$(($timestamp>$tsmax?$tsmax:$timestamp))
+ echo "Checking file: $file Updated timestamp is `date -d @$tsclamp`" >> $seqres.full
+ check_stat $file $tsclamp
+}
+
+run_test()
+{
+ update_time=$1
+
+ n=1
+
+ for TIME in "${TIMESTAMPS[@]}"
+ do
+ #Run the test
+ run_test_individual ${SCRATCH_MNT}/test_$n $TIME $update_time
+
+ #update iterator
+ ((n++))
+ done
+}
+
+_scratch_mkfs &>> $seqres.full 2>&1 || _fail "mkfs failed"
+_require_y2038 $SCRATCH_DEV
+
+read tsmin tsmax <<<$(_filesystem_timestamp_range $SCRATCH_DEV)
+echo min supported timestamp $tsmin $(date --date=@$tsmin) >> $seqres.full
+echo max supported timestamp $tsmax $(date --date=@$tsmax) >> $seqres.full
+
+# Test timestamps array
+
+declare -a TIMESTAMPS=(
+ $tsmin
+ 0
+ $tsmax
+ $((tsmax+1))
+ 4294967295
+ 8589934591
+ 34359738367
+)
+
+# Max timestamp is hardcoded to Mon Jan 18 19:14:07 PST 2038
+sys_tsmax=2147483647
+echo "max timestamp that needs to be supported by fs for rw mount is" \
+ "$((sys_tsmax+1)) $(date --date=@$((sys_tsmax+1)))" >> $seqres.full
+
+read ts_check <<<$(cat /proc/sys/fs/fs-timestamp-check-on)
+
+_scratch_mount
+result=$?
+
+if [ $ts_check -ne 0 ]; then
+ echo "sysctl filesystem timestamp check is on" >> $seqres.full
+ # check for mount failure if the minimum requirement for max timestamp
+ # supported is not met.
+ if [ $sys_tsmax -ge $tsmax ]; then
+ if [ $result -eq 0 ]; then
+ echo "mount test failed" | tee -a $seqres.full
+ exit
+ fi
+ else
+ if [ $result -ne 0 ]; then
+ echo "failed to mount $SCRATCH_DEV" | tee -a $seqres.full
+ exit
+ fi
+ fi
+else
+ # if sysctl switch is off then mount should succeed always.
+ echo "sysctl filesystem timestamp check is off" >> $seqres.full
+ if [ $result -ne 0 ]; then
+ echo "failed to mount $SCRATCH_DEV and timestamp check is off" >> $seqres.full
+ exit
+ fi
+fi
+
+# Begin test case 1
+echo "In memory timestamps update test start" >> $seqres.full
+
+# update time on the file
+update_time=1
+
+run_test $update_time
+
+echo "In memory timestamps update complete" >> $seqres.full
+
+echo "Unmounting and mounting scratch $SCRATCH_MNT" >> $seqres.full
+
+# unmount and remount $SCRATCH_DEV
+_scratch_cycle_mount
+
+# Begin test case 2
+
+n=1
+
+# Do not update time on the file this time, just read from disk
+update_time=0
+
+echo "On disk timestamps update test start" >> $seqres.full
+
+# Re-run test
+run_test $update_time
+
+echo "On disk timestamps update test complete" >> $seqres.full
+
+echo "y2038 inode timestamp tests completed successfully"
+
+# success, all done
+status=0
+exit
diff --git a/tests/generic/390.out b/tests/generic/390.out
new file mode 100644
index 0000000..82bd4eb
--- /dev/null
+++ b/tests/generic/390.out
@@ -0,0 +1,2 @@
+QA output created by 390
+y2038 inode timestamp tests completed successfully
diff --git a/tests/generic/group b/tests/generic/group
index 08007d7..d137d01 100644
--- a/tests/generic/group
+++ b/tests/generic/group
@@ -392,3 +392,4 @@
387 auto clone
388 auto log metadata
389 auto quick acl
+390 auto quick rw
--
2.7.4
I recently discussed with Rich about the work needed to get 64-bit time_t
support into musl. One of the first steps he identified was to find out which
interfaces we would want to abstract or wrap for a new ABI given that we
have to make a binary incompatible interface anyway.
I have found all the data structures that are provided by both the kernel
headers and the musl headers now, and annotated what I think we the
path forward could be. I already provided the same list on IRC, but
here is a (slightly updated) copy for everyone else.
The takeaway is that we probably need to add new definitions for
flock64, statfs, stat, termios, {msg,sem,shm}{buf,info,id_ds}, ipc_perm,
rlimit, rusage, sched_param, time_t, timeval, timespec, itimerval,
itimerspec, and timex, and then wrap all kernel interfaces that
use those.
The same list can also be helpful when we try to clean up the kernel
header files -- my idea was that we may want to prefix each struct
tag with __kernel_ as we do for typedefs, and then have a kernel
header that redefines them like
#ifdef __WANT_KERNEL_STRUCTS
#define __kernel_flock flock
#endif
struct __kernel_flock {
...
};
Arnd
/* sparc and mips are incompatible, keep wrapping flock64 */
include/uapi/asm-generic/fcntl.h:struct flock {
arch/mips/include/uapi/asm/fcntl.h:struct flock {
/* pt_regs and sigcontext are arch specific, cannot abstract */
arch/*/include/uapi/asm/ptrace.h:struct pt_regs {
arch/*/include/uapi/asm/ptrace.h:struct user_regs_struct {
arch/arm64/include/uapi/asm/sigcontext.h:struct _aarch64_ctx {
arch/arm64/include/uapi/asm/sigcontext.h:struct esr_context {
arch/arm64/include/uapi/asm/sigcontext.h:struct extra_context {
arch/arm64/include/uapi/asm/sigcontext.h:struct sve_context {
arch/*/include/uapi/asm/sigcontext.h:struct sigcontext {
/* arch specific, has wrapper */
arch/*/include/uapi/asm/signal.h:struct sigaction {
include/uapi/asm-generic/signal.h:struct sigaction {
/* arch specific, maybe add wrapper? */
arch/*/include/uapi/asm/signal.h:typedef struct sigaltstack {
include/uapi/asm-generic/signal.h:typedef struct sigaltstack {
/* arch specific, need to look closer for incompatibilities */
include/uapi/asm-generic/siginfo.h:typedef struct sigevent {
/* arch specific, should add wrapper */
arch/*/include/uapi/asm/statfs.h:struct statfs {
include/uapi/asm-generic/statfs.h:struct statfs {
/* arch specific, wrap statx instead */
arch/*/include/uapi/asm/stat.h:struct stat {
include/uapi/asm-generic/stat.h:struct stat {
include/uapi/linux/stat.h:struct statx {
include/uapi/linux/stat.h:struct statx_timestamp {
/* arch specific, should wrap termios2 where possible,
* need to check what musl does now */
arch/*/include/uapi/asm/termbits.h:struct termios {
include/uapi/asm-generic/termbits.h:struct termios {
/* IPC: wrap them all */
include/uapi/linux/mqueue.h:struct mq_attr {
include/uapi/linux/msg.h:struct msgbuf {
include/uapi/linux/msg.h:struct msginfo {
include/uapi/linux/msg.h:struct msqid_ds {
include/uapi/linux/sem.h:struct sembuf {
include/uapi/linux/sem.h:struct semid_ds {
include/uapi/linux/sem.h:struct seminfo {
include/uapi/linux/shm.h:struct shmid_ds {
include/uapi/linux/shm.h:struct shm_info {
include/uapi/linux/shm.h:struct shminfo {
/* rlimit/rlimit64: keep using only rlimit64 */
include/uapi/linux/resource.h:struct rlimit {
include/uapi/linux/resource.h:struct rlimit64 {
/* rusuage: need to wrap: getrusage, wait4 */
include/uapi/linux/resource.h:struct rusage {
/* wrapped already, replace with a more extensible one */
include/uapi/linux/sched/types.h:struct sched_param {
/* prctl(PR_SET_MM); broken in kernel compat mode?
* could be wrapped if necessary */
include/uapi/linux/prctl.h:struct prctl_mm_map {
/* inconsistent amount of padding, maybe wrap */
include/uapi/linux/sysinfo.h:struct sysinfo {
/* time64: need to use 64-bit versions of time_t */
include/uapi/linux/time.h:timespec {
include/uapi/linux/time.h:struct itimerspec {
/* need to wrap */
include/uapi/linux/utime.h:struct utimbuf {
include/uapi/linux/time.h:timeval {
include/uapi/linux/time.h:struct itimerval {
/* no need to change */
include/uapi/linux/time.h:struct timezone {
/* probably need to wrap (depending on kernel decision) */
include/uapi/linux/timex.h:struct timex {
/* incompatible on x32 */
include/uapi/linux/times.h:struct tms {
include/uapi/linux/uio.h:struct iovec {
/* tape driver ioctls, musl copy is incompatible
* on mips64, sparc64 */
include/uapi/linux/mtio.h:struct mtget {
include/uapi/linux/mtio.h:struct mtop {
include/uapi/linux/mtio.h:struct mtpos {
/* compatible, no need to wrap */
include/uapi/asm-generic/fcntl.h:struct f_owner_ex {
include/uapi/asm-generic/poll.h:struct pollfd {
include/uapi/asm-generic/termios.h:struct winsize {
include/uapi/linux/acct.h:struct acct_v3
include/uapi/linux/eventpoll.h:struct epoll_event {
include/uapi/linux/fanotify.h:struct fanotify_event_metadata {
include/uapi/linux/fanotify.h:struct fanotify_response {
include/uapi/linux/signalfd.h:struct signalfd_siginfo {
/* fixed wire format */
include/uapi/linux/udp.h:struct udphdr {
include/uapi/linux/icmp.h:struct icmphdr {
include/uapi/linux/if_arp.h:struct arphdr {
include/uapi/linux/tcp.h:struct tcphdr {
include/uapi/linux/if_ether.h:struct ethhdr {
include/uapi/linux/ip.h:struct iphdr {
/* other network stuff, fixed format */
include/uapi/linux/icmpv6.h:struct icmp6_filter {
include/uapi/linux/if_arp.h:struct arpreq {
include/uapi/linux/if_arp.h:struct arpreq_old {
include/uapi/linux/if.h:struct ifconf {
include/uapi/linux/if.h:struct ifmap {
include/uapi/linux/if.h:struct ifreq {
include/uapi/linux/if_packet.h:struct packet_mreq {
include/uapi/linux/if_packet.h:struct sockaddr_ll {
include/uapi/linux/in6.h:struct in6_addr {
include/uapi/linux/in6.h:struct ipv6_mreq {
include/uapi/linux/in6.h:struct sockaddr_in6 {
include/uapi/linux/in.h:struct group_filter {
include/uapi/linux/in.h:struct group_req {
include/uapi/linux/in.h:struct group_source_req {
include/uapi/linux/in.h:struct in_addr {
include/uapi/linux/in.h:struct in_pktinfo {
include/uapi/linux/in.h:struct ip_mreq {
include/uapi/linux/in.h:struct ip_mreqn {
include/uapi/linux/in.h:struct ip_mreq_source {
include/uapi/linux/in.h:struct ip_msfilter {
include/uapi/linux/in.h:struct sockaddr_in {
include/uapi/linux/inotify.h:struct inotify_event {
include/uapi/linux/ipc.h:struct ipc_perm
include/uapi/linux/ipv6.h:struct in6_pktinfo {
include/uapi/linux/ipv6.h:struct ip6_mtuinfo {
include/uapi/linux/ipv6_route.h:struct in6_rtmsg {
include/uapi/linux/route.h:struct rtentry {
include/uapi/linux/tcp.h:struct tcp_diag_md5sig {
include/uapi/linux/tcp.h:struct tcp_info {
include/uapi/linux/tcp.h:struct tcp_md5sig {
include/uapi/linux/tcp.h:struct tcp_repair_window {
include/uapi/linux/un.h:struct sockaddr_un {
/* shared typedefs: all in ELF format; can't change */
arch/*/include/uapi/asm/elf.h:typedef ... elf_fpregset_t;
arch/*/include/uapi/asm/elf.h:typedef ... elf_greg_t;
arch/*/include/uapi/asm/elf.h:typedef elf_greg_t elf_gregset_t[ELF_NGREG];
arch/sparc/include/uapi/asm/uctx.h:} mcontext_t;
arch/sparc/include/uapi/asm/uctx.h:typedef struct ucontext ucontext_t;
include/uapi/linux/elf.h:typedef struct elf32_hdr Elf32_Ehdr;
include/uapi/linux/elf.h:typedef struct elf64_hdr Elf64_Ehdr;
include/uapi/linux/elf.h:typedef struct {...} Elf32_Shdr;
include/uapi/linux/elf.h:typedef struct {...} Elf64_Shdr;
include/uapi/linux/elf.h:typedef struct {...} Elf32_Chdr;
include/uapi/linux/elf.h:typedef struct {...} Elf64_Chdr;
include/uapi/linux/elf.h:typedef struct {...} Elf32_Nhdr;
include/uapi/linux/elf.h:typedef struct {...} Elf64_Nhdr;
include/uapi/linux/elf.h:typedef ...
include/uapi/linux/elfcore.h:typedef elf_gregset_t gregset_t;
include/uapi/linux/elfcore.h: elf_gregset_t pr_reg; /* GP registers */
include/uapi/linux/elfcore.h:typedef elf_greg_t greg_t;
include/uapi/linux/elfcore.h:typedef elf_gregset_t gregset_t;
include/uapi/linux/elfcore.h:typedef elf_fpregset_t fpregset_t;
include/uapi/linux/elfcore.h:struct elf_prpsinfo
include/uapi/linux/elfcore.h:struct elf_prstatus
include/uapi/linux/elfcore.h:struct elf_siginfo
/* sg.h missing from exported kernel headers, can't change */
include/scsi/sg.h:typedef struct sg_iovec sg_iovec_t;
include/scsi/sg.h:typedef struct sg_io_hdr sg_io_hdr_t;
include/scsi/sg.h-struct sg_scsi_id {
include/scsi/sg.h:typedef struct sg_req_info sg_req_info_t;
include/scsi/sg.h:typedef struct sg_io_hdr Sg_io_hdr;
include/scsi/sg.h:typedef struct sg_io_vec Sg_io_vec;
include/scsi/sg.h:typedef struct sg_scsi_id Sg_scsi_id;
include/scsi/sg.h:typedef struct sg_req_info Sg_req_info;
include/scsi/sg.h-struct sg_header {
/* 32-bit on alpha, used in ustat (not provided by musl) */
include/uapi/asm-generic/posix_types.h:typedef __kernel_ulong_t __kernel_ino_t;
/* 64-bit on mips64, used in mtio (should fix?) and ustat */
include/uapi/asm-generic/posix_types.h:typedef int __kernel_daddr_t;
/* 16 bit on older architectures but only used in IPC interfaces,
which will get wrapped anyway */
include/uapi/asm-generic/posix_types.h:typedef unsigned int __kernel_mode_t;
include/uapi/asm-generic/posix_types.h:typedef int
__kernel_ipc_pid_t;
include/uapi/asm-generic/posix_types.h:typedef unsigned int __kernel_uid_t;
include/uapi/asm-generic/posix_types.h:typedef unsigned int __kernel_gid_t;
The usec part of the timeval is defined as
__kernel_suseconds_t tv_usec; /* microseconds */
Arnd noticed that sparc64 is the only architecture
that defines __kernel_suseconds_t as int rather than long.
This breaks the current y2038 fix for kernel as we only
access and define the timeval struct for non-kernel use cases.
But, this was hidden by an another typo in the use of __KERNEL__
qualifier.
Fix the typo, and provide an override for sparc64.
Fixes: 152194fe9c3f ("Input: extend usable life of event timestamps to 2106 on 32 bit systems")
Reported-by: Arnd Bergmann <arnd(a)arndb.de>
Signed-off-by: Deepa Dinamani <deepa.kernel(a)gmail.com>
---
include/uapi/linux/input.h | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/include/uapi/linux/input.h b/include/uapi/linux/input.h
index fb78f6f500f3..ffab958bc512 100644
--- a/include/uapi/linux/input.h
+++ b/include/uapi/linux/input.h
@@ -26,13 +26,17 @@
*/
struct input_event {
-#if (__BITS_PER_LONG != 32 || !defined(__USE_TIME_BITS64)) && !defined(__KERNEL)
+#if (__BITS_PER_LONG != 32 || !defined(__USE_TIME_BITS64)) && !defined(__KERNEL__)
struct timeval time;
#define input_event_sec time.tv_sec
#define input_event_usec time.tv_usec
#else
__kernel_ulong_t __sec;
+#ifdef CONFIG_SPARC64
+ unsigned int __usec;
+#else
__kernel_ulong_t __usec;
+#endif
#define input_event_sec __sec
#define input_event_usec __usec
#endif
--
2.17.1
Hi Linus and Thomas,
I realized that the merge window is now imminent, but I had not sent a
pull request to Thomas for the current y2038 stuff. These patches have
been around for a while though, and were in linux-next through my tree.
I got one bug report on Monday and incorporated a simple fix, which
changed the commit date for the second half of the series, in case you
are wondering.
Thomas, is it ok for you to just provide an Ack for this branch and
have Linus merge it directly?
Arnd
The following changes since commit 651022382c7f8da46cb4872a545ee1da6d097d2a:
Linux 4.20-rc1 (2018-11-04 15:37:52 -0800)
are available in the Git repository at:
https://git.kernel.org:/pub/scm/linux/kernel/git/arnd/playground.git
tags/y2038-for-4.21
for you to fetch changes up to e4b92b108c6cd6b311e4b6e85d6a87a34599a6e3:
timekeeping: remove obsolete time accessors (2018-12-18 16:13:05 +0100)
----------------------------------------------------------------
y2038: more syscalls and cleanups
This concludes the main part of the system call rework for 64-bit time_t,
which has spread over most of year 2018, the last six system calls being
- ppoll
- pselect6
- io_pgetevents
- recvmmsg
- futex
- rt_sigtimedwait
As before, nothing changes for 64-bit architectures, while 32-bit
architectures gain another entry point that differs only in the layout
of the timespec structure. Hopefully in the next release we can wire up
all 22 of those system calls on all 32-bit architectures, which gives
us a baseline version for glibc to start using them.
This does not include the clock_adjtime, getrusage/waitid, and
getitimer/setitimer system calls. I still plan to have new versions
of those as well, but they are not required for correct operation of
the C library since they can be emulated using the old 32-bit time_t
based system calls.
Aside from the system calls, there are also a few cleanups here,
removing old kernel internal interfaces that have become unused after
all references got removed. The arch/sh cleanups are part of this,
there were posted several times over the past year without a reaction
from the maintainers, while the corresponding changes made it into all
other architectures.
----------------------------------------------------------------
Arnd Bergmann (13):
y2038: futex: Move compat implementation into futex.c
y2038: futex: Add support for __kernel_timespec
y2038: socket: Add compat_sys_recvmmsg_time64
y2038: signal: Add sys_rt_sigtimedwait_time32
y2038: signal: Add compat_sys_rt_sigtimedwait_time64
sh: dreamcast: rtc: push down rtc class ops into driver
sh: sh03: rtc: push down rtc class ops into driver
sh: remove unused rtc_sh_get/set_time infrastructure
sh: remove board_time_init() callback
timekeeping: remove unused {read,update}_persistent_clock
timekeeping: remove timespec_add/timespec_del
vfs: replace current_kernel_time64 with ktime equivalent
timekeeping: remove obsolete time accessors
Deepa Dinamani (5):
signal: Add set_user_sigmask()
signal: Add restore_user_sigmask()
ppoll: use __kernel_timespec
pselect6: use __kernel_timespec
io_pgetevents: use __kernel_timespec
Documentation/sh/new-machine.txt | 8 --
arch/sh/boards/mach-dreamcast/Makefile | 4 +-
arch/sh/boards/mach-dreamcast/rtc.c | 45 +++++++---
arch/sh/boards/mach-dreamcast/setup.c | 1 -
arch/sh/boards/mach-sh03/Makefile | 3 +-
arch/sh/boards/mach-sh03/rtc.c | 51 ++++++-----
arch/sh/boards/mach-sh03/setup.c | 9 --
arch/sh/boards/of-generic.c | 8 --
arch/sh/configs/dreamcast_defconfig | 2 +
arch/sh/configs/sh03_defconfig | 2 +
arch/sh/include/asm/rtc.h | 3 -
arch/sh/include/mach-dreamcast/mach/sysasic.h | 1 -
arch/sh/kernel/time.c | 74 +---------------
fs/aio.c | 134
++++++++++++++++++++---------
fs/eventpoll.c | 52 ++----------
fs/inode.c | 4 +-
fs/select.c | 360
+++++++++++++++++++++++++++++++++++++++++++++---------------------------------
include/linux/compat.h | 26 ++++++
include/linux/futex.h | 8 --
include/linux/signal.h | 4 +
include/linux/socket.h | 9 +-
include/linux/syscalls.h | 29 +++++--
include/linux/time32.h | 25 ------
include/linux/timekeeping.h | 14 ---
include/linux/timekeeping32.h | 15 ----
kernel/Makefile | 3 -
kernel/futex.c | 207
+++++++++++++++++++++++++++++++++++++++++++--
kernel/futex_compat.c | 202
--------------------------------------------
kernel/signal.c | 143
+++++++++++++++++++++++++++++++
kernel/sys_ni.c | 2 +
kernel/time/ntp.c | 10 +--
kernel/time/time.c | 36 --------
kernel/time/timekeeping.c | 12 +--
net/compat.c | 34 +++-----
net/socket.c | 62 ++++++++++----
35 files changed, 847 insertions(+), 755 deletions(-)
delete mode 100644 kernel/futex_compat.c
The following changes since commit 2e6e902d185027f8e3cb8b7305238f7e35d6a436:
Linux 4.20-rc4 (2018-11-25 14:19:31 -0800)
are available in the Git repository at:
git://git.kernel.org/pub/scm/linux/kernel/git/arnd/asm-generic.git
tags/asm-generic-4.21
for you to fetch changes up to 2b3c5a99d5f314960e00950c1782eac9361de30f:
sh: generate uapi header and syscall table header files (2018-12-19
17:54:40 +0100)
----------------------------------------------------------------
asm-generic: syscall table script for arch/sh
I worked with Firoz Khan to change all architectures to have their system
call tables (syscall.S and asm/unistd.h) generated by a script from a more
readable input file the same way that we already had on x86, s390 and arm.
I offered to take those conversions through the asm-generic tree that
did not get picked up by the architecture maintainers, and fortunately
all but one have now been accepted into arch maintainer trees, so this
branch only contains the conversion for arch/sh/, with permission from
Rich.
The conversion does not include the old 64-bit sh5 architecture, which
has never shipped and not even compiled in a long time. The table
in include/uapi/asm/unistd.h is also not included here, as Firoz is
still working on that one. It will have to wait for the next following
merge window, hopefully together with the addition of the 64-bit
time_t system calls for the y2038 work that led to the system call
table rework.
Acked-by: Rich Felker <dalias(a)libc.org>
Signed-off-by: Arnd Bergmann <arnd(a)arndb.de>
----------------------------------------------------------------
Firoz Khan (3):
sh: add __NR_syscalls along with NR_syscalls
sh: add system call table generation support
sh: generate uapi header and syscall table header files
arch/sh/Makefile | 3 +
arch/sh/include/asm/Kbuild | 1 +
arch/sh/include/asm/unistd.h | 2 +
arch/sh/include/uapi/asm/Kbuild | 1 +
arch/sh/include/uapi/asm/unistd_32.h | 4 +-
arch/sh/include/uapi/asm/unistd_64.h | 4 +-
arch/sh/kernel/syscalls/Makefile | 38 +++++++++
arch/sh/kernel/syscalls/syscall.tbl | 392
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
arch/sh/kernel/syscalls/syscallhdr.sh | 36 ++++++++
arch/sh/kernel/syscalls/syscalltbl.sh | 32 +++++++
arch/sh/kernel/syscalls_32.S | 387
+-----------------------------------------------------------------------------------
11 files changed, 514 insertions(+), 386 deletions(-)
create mode 100644 arch/sh/kernel/syscalls/Makefile
create mode 100644 arch/sh/kernel/syscalls/syscall.tbl
create mode 100644 arch/sh/kernel/syscalls/syscallhdr.sh
create mode 100644 arch/sh/kernel/syscalls/syscalltbl.sh
The purpose of this patch series is, we can easily
add/modify/delete system call table support by cha-
nging entry in syscall.tbl file instead of manually
changing many files. The other goal is to unify the
system call table generation support implementation
across all the architectures.
The system call tables are in different format in
all architecture. It will be difficult to manually
add, modify or delete the system calls in the resp-
ective files manually. To make it easy by keeping a
script and which'll generate uapi header file and
syscall table file.
syscall.tbl contains the list of available system
calls along with system call number and correspond-
ing entry point. Add a new system call in this arch-
itecture will be possible by adding new entry in
the syscall.tbl file.
Adding a new table entry consisting of:
- System call number.
- ABI.
- System call name.
- Entry point name.
- Compat entry name, if required.
ARM, s390 and x86 architecuture does exist the sim-
ilar support. I leverage their implementation to
come up with a generic solution.
I have done the same support for work for alpha,
ia64, m68k, microblaze, parisc, powerpc, sh, sparc,
and xtensa. Below mentioned git repository contains
more details about the workflow.
https://github.com/frzkhn/system_call_table_generator/
Finally, this is the ground work to solve the Y2038
issue. We need to add two dozen of system calls to
solve Y2038 issue. So this patch series will help to
add new system calls easily by adding new entry in
the syscall.tbl.
Changes since v4:
- _MIPS_SIM_ABIN64 (suppose to be _MIPS_SIM_NABI64)
macro rename back to _MIPS_SIM_ABI64 to avoid
toolchain issue.
Changes since v3:
- rearranged the patches for '64' to 'n64' conver-
sion.
- moved the unistd_nr_*.h files to asm/unistd.h
- modified the *.sh files.
Changes since v2:
- fixed __NR_syscalls assign issue.
Changes since v1:
- optimized/updated the syscall table generation
scripts.
- fixed all mixed indentation issues in syscall.tbl.
- added "comments" in syscall_*.tbl.
- changed from generic-y to generated-y in Kbuild.
Firoz Khan (7):
mips: add __NR_syscalls along with __NR_Linux_syscalls
mips: remove unused macros
mips: rename macros and files from '64' to 'n64'
mips: add +1 to __NR_syscalls in uapi header
mips: remove syscall table entries
mips: add system call table generation support
mips: generate uapi header and system call table files
arch/mips/Makefile | 3 +
arch/mips/include/asm/Kbuild | 4 +
arch/mips/include/asm/unistd.h | 11 +-
arch/mips/include/uapi/asm/Kbuild | 6 +
arch/mips/include/uapi/asm/unistd.h | 1074 +----------------------------
arch/mips/kernel/Makefile | 2 +-
arch/mips/kernel/ftrace.c | 8 +-
arch/mips/kernel/scall32-o32.S | 391 +----------
arch/mips/kernel/scall64-64.S | 444 ------------
arch/mips/kernel/scall64-n32.S | 341 +--------
arch/mips/kernel/scall64-n64.S | 117 ++++
arch/mips/kernel/scall64-o32.S | 379 +---------
arch/mips/kernel/syscalls/Makefile | 96 +++
arch/mips/kernel/syscalls/syscall_n32.tbl | 343 +++++++++
arch/mips/kernel/syscalls/syscall_n64.tbl | 339 +++++++++
arch/mips/kernel/syscalls/syscall_o32.tbl | 382 ++++++++++
arch/mips/kernel/syscalls/syscallhdr.sh | 37 +
arch/mips/kernel/syscalls/syscallnr.sh | 28 +
arch/mips/kernel/syscalls/syscalltbl.sh | 36 +
19 files changed, 1427 insertions(+), 2614 deletions(-)
delete mode 100644 arch/mips/kernel/scall64-64.S
create mode 100644 arch/mips/kernel/scall64-n64.S
create mode 100644 arch/mips/kernel/syscalls/Makefile
create mode 100644 arch/mips/kernel/syscalls/syscall_n32.tbl
create mode 100644 arch/mips/kernel/syscalls/syscall_n64.tbl
create mode 100644 arch/mips/kernel/syscalls/syscall_o32.tbl
create mode 100644 arch/mips/kernel/syscalls/syscallhdr.sh
create mode 100644 arch/mips/kernel/syscalls/syscallnr.sh
create mode 100644 arch/mips/kernel/syscalls/syscalltbl.sh
--
1.9.1
The purpose of this patch series is, we can easily
add/modify/delete system call table support by cha-
nging entry in syscall.tbl file instead of manually
changing many files. The other goal is to unify the
system call table generation support implementation
across all the architectures.
The system call tables are in different format in
all architecture. It will be difficult to manually
add, modify or delete the system calls in the resp-
ective files manually. To make it easy by keeping a
script and which'll generate uapi header file and
syscall table file.
syscall.tbl contains the list of available system
calls along with system call number and correspond-
ing entry point. Add a new system call in this arch-
itecture will be possible by adding new entry in
the syscall.tbl file.
Adding a new table entry consisting of:
- System call number.
- ABI.
- System call name.
- Entry point name.
- Compat entry name, if required.
- spu entry name, if required.
ARM, s390 and x86 architecuture does exist the sim-
ilar support. I leverage their implementation to
come up with a generic solution.
I have done the same support for work for alpha,
ia64, m68k, microblaze, mips, parisc, sh, sparc,
and xtensa. Below mentioned git repository contains
more details about the workflow.
https://github.com/frzkhn/system_call_table_generator/
Finally, this is the ground work to solve the Y2038
issue. We need to add two dozen of system calls to
solve Y2038 issue. So this patch series will help to
add new system calls easily by adding new entry in the
syscall.tbl.
Changes since v5:
- rebased with 4.20-rc7.
Changes since v4:
- DOTSYM macro removed for ppc32, which was causing
the compilation error.
Changes since v3:
- split compat syscall table out from native table.
- modified the script to add new line in the generated
file.
Changes since v2:
- modified/optimized the syscall.tbl to avoid duplicate
for the spu entries.
- updated the syscalltbl.sh to meet the above point.
Changes since v1:
- optimized/updated the syscall table generation
scripts.
- fixed all mixed indentation issues in syscall.tbl.
- added "comments" in syscall_*.tbl.
- changed from generic-y to generated-y in Kbuild.
Firoz Khan (5):
powerpc: add __NR_syscalls along with NR_syscalls
powerpc: move macro definition from asm/systbl.h
powerpc: add system call table generation support
powerpc: split compat syscall table out from native table
powerpc: generate uapi header and system call table files
arch/powerpc/Makefile | 3 +
arch/powerpc/include/asm/Kbuild | 4 +
arch/powerpc/include/asm/syscall.h | 3 +-
arch/powerpc/include/asm/systbl.h | 396 --------------------------
arch/powerpc/include/asm/unistd.h | 3 +-
arch/powerpc/include/uapi/asm/Kbuild | 2 +
arch/powerpc/include/uapi/asm/unistd.h | 389 +------------------------
arch/powerpc/kernel/Makefile | 10 -
arch/powerpc/kernel/entry_64.S | 7 +-
arch/powerpc/kernel/syscalls/Makefile | 63 ++++
arch/powerpc/kernel/syscalls/syscall.tbl | 427 ++++++++++++++++++++++++++++
arch/powerpc/kernel/syscalls/syscallhdr.sh | 37 +++
arch/powerpc/kernel/syscalls/syscalltbl.sh | 36 +++
arch/powerpc/kernel/systbl.S | 40 ++-
arch/powerpc/kernel/systbl_chk.c | 60 ----
arch/powerpc/kernel/vdso.c | 7 +-
arch/powerpc/platforms/cell/spu_callbacks.c | 17 +-
17 files changed, 606 insertions(+), 898 deletions(-)
delete mode 100644 arch/powerpc/include/asm/systbl.h
create mode 100644 arch/powerpc/kernel/syscalls/Makefile
create mode 100644 arch/powerpc/kernel/syscalls/syscall.tbl
create mode 100644 arch/powerpc/kernel/syscalls/syscallhdr.sh
create mode 100644 arch/powerpc/kernel/syscalls/syscalltbl.sh
delete mode 100644 arch/powerpc/kernel/systbl_chk.c
--
1.9.1