System call table generation support is provided for
alpha, ia64, m68k, microblaze, mips, parisc, powerpc,
sh, sparc and xtensa architectures. The implementat-
ions are almost similar across all the above archte-
ctures. In order to reduce the source code across all
the above architectures, create common ".sh" files and
keep it in the common directory, script/. This will
be a generic scripts which can use for all the above
architectures.
This patch depends on;
https://lore.kernel.org/lkml/1546439331-18646-1-git-send-email-firoz.khan@l…
Firoz Khan (2):
mips: remove nargs from __SYSCALL
mips: generate uapi header and system call table files
arch/mips/kernel/scall32-o32.S | 2 +-
arch/mips/kernel/scall64-n32.S | 2 +-
arch/mips/kernel/scall64-n64.S | 2 +-
arch/mips/kernel/scall64-o32.S | 2 +-
arch/mips/kernel/syscalls/Makefile | 6 +++---
arch/mips/kernel/syscalls/syscallhdr.sh | 37 ---------------------------------
arch/mips/kernel/syscalls/syscallnr.sh | 28 -------------------------
arch/mips/kernel/syscalls/syscalltbl.sh | 36 --------------------------------
8 files changed, 7 insertions(+), 108 deletions(-)
delete mode 100644 arch/mips/kernel/syscalls/syscallhdr.sh
delete mode 100644 arch/mips/kernel/syscalls/syscallnr.sh
delete mode 100644 arch/mips/kernel/syscalls/syscalltbl.sh
--
1.9.1
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
System call table generation support is provided for
alpha, ia64, m68k, microblaze, mips, parisc, powerpc,
sh, sparc and xtensa architectures. The implementat-
ions are almost similar across all the above archte-
ctures. In order to reduce the source code across all
the above architectures, create common ".sh" files and
keep it in the common directory, script/. This will
be a generic scripts which can use for all the above
architectures.
This patch depends on;
https://lore.kernel.org/lkml/1546439331-18646-1-git-send-email-firoz.khan@l…
Firoz Khan (2):
powerpc: remove nargs from __SYSCALL
powerpc: generate uapi header and system call table files
arch/powerpc/kernel/syscalls/Makefile | 11 +++++++--
arch/powerpc/kernel/syscalls/syscallhdr.sh | 37 -----------------------------
arch/powerpc/kernel/syscalls/syscalltbl.sh | 36 ----------------------------
arch/powerpc/kernel/systbl.S | 6 ++---
arch/powerpc/platforms/cell/spu_callbacks.c | 2 +-
5 files changed, 13 insertions(+), 79 deletions(-)
delete mode 100644 arch/powerpc/kernel/syscalls/syscallhdr.sh
delete mode 100644 arch/powerpc/kernel/syscalls/syscalltbl.sh
--
1.9.1
System call table generation support is provided for
alpha, ia64, m68k, microblaze, mips, parisc, powerpc,
sh, sparc and xtensa architectures. The implementat-
ions are almost similar across all the above archte-
ctures. In order to reduce the source code across all
the above architectures, create common ".sh" files and
keep it in the common directory, script/. This will
be a generic scripts which can use for all the above
architectures.
This patch depends on;
https://lore.kernel.org/lkml/1546439331-18646-1-git-send-email-firoz.khan@l…
Firoz Khan (3):
sparc: remove nargs from __SYSCALL
sparc: rename not implemented system call
sparc: generate uapi header and system call table files
arch/sparc/kernel/syscalls/Makefile | 11 ++++++++--
arch/sparc/kernel/syscalls/syscall.tbl | 26 +++++++++++------------
arch/sparc/kernel/syscalls/syscallhdr.sh | 36 --------------------------------
arch/sparc/kernel/syscalls/syscalltbl.sh | 36 --------------------------------
arch/sparc/kernel/systbls_32.S | 3 ++-
arch/sparc/kernel/systbls_64.S | 4 +++-
6 files changed, 27 insertions(+), 89 deletions(-)
delete mode 100644 arch/sparc/kernel/syscalls/syscallhdr.sh
delete mode 100644 arch/sparc/kernel/syscalls/syscalltbl.sh
--
1.9.1
Hi,
I was going through your website & I figured it'd be worth leaving a note.
We can help you with a fresh content and redesign your website according to
your requirement, promote your business online which would not only make you
rank high on search engines on relevant keywords, but we will also help you
uplift your brand in the market and get huge traffic with good number of
Inbound Leads to boost your product sales and services you provide.
Would you be open to seeing briefer info/quote for what I would like to
accomplish?
Please email us back to get more info.
Thanks & Regards,
Pearl Dawson
Santa Clara, CA
Senior Marketing Consultant
If you are not the right person, feel free to forward this email to the
right person in your organization.
To opt out, please reply with Leave Out in the Subject Line.
This is a minor update of the patches I posted last week, I
would like to add this into linux-next now, but would still do
changes if there are concerns about the contents. The first
version did not see a lot of replies, which could mean that
either everyone is happy with it, or that it was largely ignored.
See also the article at https://lwn.net/Articles/776435/.
Changes since v1:
- posting as a combined series for simplicity
- dropped one mips patch that was merged as a 5.0 fix
- reworked s390 compat syscall handling (posted separately)
and rebased on top of that series
- minor fixes for arm64 and powerpc
- added alpha statfs64 interfaces
- added alpha get{eg,eu,g,p,u,pp}id()
Arnd
----
v1 description for cleanup:
The system call tables have diverged a bit over the years, and a number
of the recent additions never made it into all architectures, for one
reason or another.
This is an attempt to clean it up as far as we can without breaking
compatibility, doing a number of steps:
- Add system calls that have not yet been integrated into all
architectures but that we definitely want there.
- Add the separate ipc syscalls on all architectures that
traditionally only had sys_ipc(). This version is done without
support for IPC_OLD that is we have in sys_ipc. The
new semtimedop_time64 syscall will only be added here, not
in sys_ipc
- Add syscall numbers for a couple of syscalls that we probably
don't need everywhere, in particular pkey_* and rseq,
for the purpose of symmetry: if it's in asm-generic/unistd.h,
it makes sense to have it everywhere.
- Prepare for having the same system call numbers for any future
calls. In combination with the generated tables, this hopefully
makes it easier to add new calls across all architectures
together.
Most of the contents of this series are unrelated to the actual
y2038 work, but for the moment, that second series is based on
this one. If there are any concerns about changes here, I
can drop or rewrite any individual patch in this series.
My plan is to merge any patches in this series that are found
to be good together with the y2038 patches for linux-5.1, so
please review and provide Acks for merging through my tree,
or pick them up for 5.0 if they seem urgent enough.
v1 description for y2038 patches:
This series finally gets us to the point of having system calls with
64-bit time_t on all architectures, after a long time of incremental
preparation patches.
There was actually one conversion that I missed during the summer,
i.e. Deepa's timex series, which I now updated based the 5.0-rc1 changes
and review comments.
I hope that the actual conversion should be uncontroversial by now,
even if some of the patches are rather large.
The one area that may need a little discussion is for the system call
numbers assigned in the final patch: Can we get consensus on whether
the idea of using the same numbers on all architectures, as well as my
choice of numbers makes sense here?
So far, I have done a lot of build testing across most architectures,
which has found a number of bugs. I have also done an LTP run on arm32
with existing user space, but not on the other architectures. I did LTP
tests with a modified musl libc[2] last summer on an older version of
this series to make sure that the new 64-bit time_t interfaces work.
The version there will need updates for testing with this new kernel
patch series; I plan to do that next.
For testing, the series plus the preparatory patches is available at
[3]. Once there is a general agreement on this series and I have done
more tests for the new system calls, I plan to add this to linux-next
through my asm-generic tree or Thomas' timers tree.
Please review and test!
Arnd
[1] https://lore.kernel.org/lkml/20190110162435.309262-1-arnd@arndb.de/T/
[2] https://git.linaro.org/people/arnd/musl-y2038.git/
[3] https://git.kernel.org/pub/scm/linux/kernel/git/arnd/playground.git y2038-5.0-rc1
Arnd Bergmann (26):
ia64: add __NR_umount2 definition
ia64: add statx and io_pgetevents syscalls
ia64: assign syscall numbers for perf and seccomp
alpha: wire up io_pgetevents system call
alpha: update syscall macro definitions
ARM: add migrate_pages() system call
ARM: add kexec_file_load system call number
m68k: assign syscall number for seccomp
sh: remove duplicate unistd_32.h file
sh: add statx system call
sparc64: fix sparc_ipc type conversion
ipc: rename old-style shmctl/semctl/msgctl syscalls
arch: add split IPC system calls where needed
arch: add pkey and rseq syscall numbers everywhere
alpha: add standard statfs64/fstatfs64 syscalls
alpha: add generic get{eg,eu,g,p,u,pp}id() syscalls
syscalls: remove obsolete __IGNORE_ macros
time: make adjtime compat handling available for 32 bit
time: fix sys_timer_settime prototype
sparc64: add custom adjtimex/clock_adjtime functions
x86/x32: use time64 versions of sigtimedwait and recvmmsg
y2038: syscalls: rename y2038 compat syscalls
y2038: use time32 syscall names on 32-bit
y2038: remove struct definition redirects
y2038: rename old time and utime syscalls
y2038: add 64-bit time_t syscalls to all 32-bit architectures
Deepa Dinamani (3):
time: Add struct __kernel_timex
timex: use __kernel_timex internally
timex: change syscalls to use struct __kernel_timex
arch/Kconfig | 2 +-
arch/alpha/include/asm/unistd.h | 21 -
arch/alpha/include/uapi/asm/unistd.h | 10 +
arch/alpha/kernel/osf_sys.c | 5 +-
arch/alpha/kernel/syscalls/syscall.tbl | 22 +-
arch/arm/include/asm/unistd.h | 5 +-
arch/arm/kernel/sys_oabi-compat.c | 8 +-
arch/arm/tools/syscall.tbl | 85 +++--
arch/arm64/include/asm/unistd.h | 2 +-
arch/arm64/include/asm/unistd32.h | 99 +++--
arch/ia64/include/asm/unistd.h | 14 -
arch/ia64/include/uapi/asm/unistd.h | 2 +
arch/ia64/kernel/syscalls/syscall.tbl | 11 +-
arch/m68k/include/asm/unistd.h | 4 +-
arch/m68k/kernel/syscalls/syscall.tbl | 88 +++--
arch/microblaze/include/asm/unistd.h | 4 +-
arch/microblaze/kernel/syscalls/syscall.tbl | 83 ++--
arch/mips/include/asm/unistd.h | 20 +-
arch/mips/kernel/syscalls/syscall_n32.tbl | 77 ++--
arch/mips/kernel/syscalls/syscall_n64.tbl | 7 +-
arch/mips/kernel/syscalls/syscall_o32.tbl | 85 +++--
arch/parisc/include/asm/unistd.h | 15 +-
arch/parisc/kernel/syscalls/syscall.tbl | 109 ++++--
arch/powerpc/include/asm/unistd.h | 8 +-
arch/powerpc/kernel/syscalls/syscall.tbl | 134 +++++--
arch/s390/include/asm/unistd.h | 7 +-
arch/s390/kernel/syscalls/syscall.tbl | 87 +++--
arch/sh/include/asm/unistd.h | 4 +-
arch/sh/include/uapi/asm/unistd_32.h | 403 --------------------
arch/sh/kernel/syscalls/syscall.tbl | 88 +++--
arch/sparc/include/asm/unistd.h | 13 +-
arch/sparc/kernel/sys_sparc_64.c | 61 ++-
arch/sparc/kernel/syscalls/syscall.tbl | 116 ++++--
arch/x86/entry/syscalls/syscall_32.tbl | 85 +++--
arch/x86/entry/syscalls/syscall_64.tbl | 4 +-
arch/x86/include/asm/unistd.h | 8 +-
arch/xtensa/include/asm/unistd.h | 14 +-
arch/xtensa/kernel/syscalls/syscall.tbl | 78 ++--
drivers/ptp/ptp_clock.c | 2 +-
fs/aio.c | 10 +-
fs/select.c | 4 +-
fs/timerfd.c | 4 +-
fs/utimes.c | 10 +-
include/linux/compat.h | 104 +----
include/linux/posix-clock.h | 2 +-
include/linux/syscalls.h | 68 +++-
include/linux/time32.h | 32 +-
include/linux/time64.h | 8 -
include/linux/timex.h | 4 +-
include/uapi/asm-generic/unistd.h | 103 +++--
include/uapi/linux/time.h | 4 -
include/uapi/linux/timex.h | 39 ++
ipc/mqueue.c | 16 +-
ipc/msg.c | 39 +-
ipc/sem.c | 41 +-
ipc/shm.c | 40 +-
ipc/syscall.c | 12 +-
ipc/util.h | 21 +-
kernel/compat.c | 64 ----
kernel/futex.c | 2 +-
kernel/sched/core.c | 5 +-
kernel/signal.c | 2 +-
kernel/sys_ni.c | 21 +-
kernel/time/hrtimer.c | 2 +-
kernel/time/ntp.c | 18 +-
kernel/time/ntp_internal.h | 2 +-
kernel/time/posix-clock.c | 2 +-
kernel/time/posix-stubs.c | 25 +-
kernel/time/posix-timers.c | 72 ++--
kernel/time/posix-timers.h | 2 +-
kernel/time/time.c | 92 ++++-
kernel/time/timekeeping.c | 4 +-
net/compat.c | 2 +-
scripts/checksyscalls.sh | 40 ++
74 files changed, 1544 insertions(+), 1262 deletions(-)
delete mode 100644 arch/sh/include/uapi/asm/unistd_32.h
--
2.20.0
Cc: mattst88(a)gmail.com
Cc: linux(a)armlinux.org.uk
Cc: catalin.marinas(a)arm.com
Cc: will.deacon(a)arm.com
Cc: tony.luck(a)intel.com
Cc: fenghua.yu(a)intel.com
Cc: geert(a)linux-m68k.org
Cc: monstr(a)monstr.eu
Cc: paul.burton(a)mips.com
Cc: deller(a)gmx.de
Cc: benh(a)kernel.crashing.org
Cc: mpe(a)ellerman.id.au
Cc: schwidefsky(a)de.ibm.com
Cc: heiko.carstens(a)de.ibm.com
Cc: dalias(a)libc.org
Cc: davem(a)davemloft.net
Cc: luto(a)kernel.org
Cc: tglx(a)linutronix.de
Cc: mingo(a)redhat.com
Cc: hpa(a)zytor.com
Cc: x86(a)kernel.org
Cc: jcmvbkbc(a)gmail.com
Cc: arnd(a)arndb.de
Cc: akpm(a)linux-foundation.org
Cc: deepa.kernel(a)gmail.com
Cc: ebiederm(a)xmission.com
Cc: firoz.khan(a)linaro.org
Cc: linux-kernel(a)vger.kernel.org
Cc: linux-alpha(a)vger.kernel.org
Cc: linux-arm-kernel(a)lists.infradead.org
Cc: linux-ia64(a)vger.kernel.org
Cc: linux-m68k(a)lists.linux-m68k.org
Cc: linux-mips(a)vger.kernel.org
Cc: linux-parisc(a)vger.kernel.org
Cc: linuxppc-dev(a)lists.ozlabs.org
Cc: linux-s390(a)vger.kernel.org
Cc: linux-sh(a)vger.kernel.org
Cc: sparclinux(a)vger.kernel.org
Cc: netdev(a)vger.kernel.org
Cc: linux-fsdevel(a)vger.kernel.org
Cc: linux-api(a)vger.kernel.org
Cc: linux-arch(a)vger.kernel.org
This will be an automated scripts to provide easy support
for add/modify/delete the system call entry by add in
respective *.tbl file.
System call table generation support for asm-generic is
provide for arm64 architecture which will use the common
scripts resides in scripts directory and use syscall.tbl
syscall_arm32.tbl files as inputs. This implementation
will replace asm-generic/unistd.h.
This patch depends on:
https://lore.kernel.org/lkml/1546439331-18646-1-git-send-email-firoz.khan@l…https://lore.kernel.org/lkml/1546520681-24453-1-git-send-email-firoz.khan@l…
Firoz Khan (3):
arm64: add system call table generation files
arm64: assign __NR_*_Linux_syscalls generated by the scripts
arm64: generate uapi and kapi headers
arch/arm64/Makefile | 3 +
arch/arm64/include/asm/Kbuild | 2 +
arch/arm64/include/asm/unistd.h | 10 +-
arch/arm64/include/asm/unistd32.h | 826 ---------------------------
arch/arm64/include/uapi/asm/Kbuild | 4 +
arch/arm64/include/uapi/asm/unistd.h | 13 +-
arch/arm64/kernel/sys.c | 8 +-
arch/arm64/kernel/sys32.c | 8 +-
arch/arm64/kernel/syscall.c | 4 +-
arch/arm64/kernel/syscalls/Makefile | 70 +++
arch/arm64/kernel/syscalls/syscall_arm32.tbl | 434 ++++++++++++++
lib/compat_audit.c | 2 +-
12 files changed, 540 insertions(+), 844 deletions(-)
delete mode 100644 arch/arm64/include/asm/unistd32.h
create mode 100644 arch/arm64/kernel/syscalls/Makefile
create mode 100644 arch/arm64/kernel/syscalls/syscall_arm32.tbl
--
1.9.1
Hi Heiko and Martin,
As promised, I gave this a go and changed the SYSCALL_DEFINEx()
infrastructure to always include the wrappers for doing the
31-bit argument conversion on s390 compat mode.
This does three main things:
- The UID16 rework saved a lot of duplicated code, and would
probably make sense by itself, but is also required as
we can no longer call sys_*() functions directly after the
last step.
- Removing the compat_wrapper.c file is of course the main
goal here, in order to remove the need to maintain the
compat_wrapper.c file when new system calls get added.
Unfortunately, this requires adding some complexity in
syscall_wrapper.h, and trades a small reduction in source
code lines for a small increase in binary size for
unused wrappers.
- As an added benefit, the use of syscall_wrapper.h now makes
it easy to change the syscall wrappers so they no longer
see all user space register contents, similar to changes
done in commits fa697140f9a2 ("syscalls/x86: Use 'struct pt_regs'
based syscall calling convention for 64-bit syscalls") and
4378a7d4be30 ("arm64: implement syscall wrappers").
I leave the actual implementation of this for you, if you
want to do it later.
I did not test the changes at runtime, but I looked at the
generated object code, which seems fine here and includes
the same conversions as before.
Arnd
Arnd Bergmann (5):
s390: open-code s390_personality syscall
ipc: introduce ksys_ipc()/compat_ksys_ipc() for s390
s390: use generic UID16 implementation
s390: autogenerate compat syscall wrappers
s390: remove compat_wrapper.c
arch/s390/Kconfig | 2 +
arch/s390/include/asm/syscall_wrapper.h | 136 +++++++++++
arch/s390/include/uapi/asm/posix_types.h | 6 +
arch/s390/kernel/Makefile | 2 +-
arch/s390/kernel/compat_linux.c | 235 +------------------
arch/s390/kernel/compat_wrapper.c | 186 ---------------
arch/s390/kernel/entry.S | 4 +-
arch/s390/kernel/sys_s390.c | 14 +-
arch/s390/kernel/syscalls/syscall.tbl | 286 +++++++++++------------
include/linux/syscalls.h | 4 +
ipc/syscall.c | 20 +-
11 files changed, 322 insertions(+), 573 deletions(-)
create mode 100644 arch/s390/include/asm/syscall_wrapper.h
delete mode 100644 arch/s390/kernel/compat_wrapper.c
--
2.20.0
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;