All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v9 00/24] ILP32 for ARM64
@ 2018-05-15 19:11 ` Yury Norov
  0 siblings, 0 replies; 104+ messages in thread
From: Yury Norov @ 2018-05-15 19:11 UTC (permalink / raw)
  To: Catalin Marinas, Arnd Bergmann, linux-arm-kernel, linux-kernel,
	linux-doc, linux-arch, linux-api
  Cc: Yury Norov, Adam Borowski, Alexander Graf, Alexey Klimov,
	Andreas Schwab, Andrew Pinski, Bamvor Zhangjian, Chris Metcalf,
	Christoph Muellner, Dave Martin, David S . Miller,
	Florian Weimer, Geert Uytterhoeven, Heiko Carstens, James Hogan,
	James Morse, Joseph Myers, Lin Yongting, Manuel Montezelo,
	Mark Brown, Martin Schwidefsky, Maxim Kuvyrkov, Nathan_Lynch,
	Philipp Tomsich, Prasun Kapoor, Ramana Radhakrishnan,
	Steve Ellcey, Szabolcs Nagy, Zhou Chengming

This series enables AARCH64 with ILP32 mode.

As supporting work, it introduces ARCH_32BIT_OFF_T configuration
option that is enabled for existing 32-bit architectures but disabled
for new arches (so 64-bit off_t userspace type is used by new userspace).
Also it deprecates getrlimit and setrlimit syscalls prior to prlimit64.

Based on kernel v4.16. Tested with LTP, glibc testsuite, trinity, lmbench,
CPUSpec.

This series on github: 
https://github.com/norov/linux/tree/ilp32-4.16
Linaro toolchain:
http://snapshots.linaro.org/components/toolchain/binaries/7.3-2018.04-rc1/aarch64-linux-gnu_ilp32/
Debian repo:
http://people.linaro.org/~wookey/ilp32/
OpenSUSE repo:
https://build.opensuse.org/project/show/devel:ARM:Factory:Contrib:ILP32

Changes:
v3: https://lkml.org/lkml/2014/9/3/704
v4: https://lkml.org/lkml/2015/4/13/691
v5: https://lkml.org/lkml/2015/9/29/911
v6: https://lkml.org/lkml/2016/5/23/661
v7: https://lkml.org/lkml/2017/1/9/213
v8: https://lkml.org/lkml/2017/6/19/624
v9: - rebased on top of v4.16;
    - signal subsystem reworked to avoid code duplication, as requested
      by Dave Martin (patches 18 and 20);
    - new files introduced in series use SPDX notation for license;
    - linux-api and linux-arch CCed as the series changes kernel ABI;
    - checkpatch and other minor fixes.

Andrew Pinski (4):
  arm64: rename COMPAT to AARCH32_EL0 in Kconfig
  arm64:uapi: set __BITS_PER_LONG correctly for ILP32 and LP64
  arm64: ilp32: add sys_ilp32.c and a separate table (in entry.S) to use
    it
  arm64:ilp32: add ARM64_ILP32 to Kconfig

Catalin Marinas (1):
  arm64: ilp32: Make the Kconfig option default y

Dave Martin (1):
  arm64: signal: Make parse_user_sigframe() independent of rt_sigframe
    layout

James Morse (1):
  ptrace: Add compat PTRACE_{G,S}ETSIGMASK handlers

Philipp Tomsich (1):
  arm64:ilp32: add vdso-ilp32 and use for signal return

Yury Norov (16):
  compat ABI: use non-compat openat and open_by_handle_at variants
  32-bit userspace ABI: introduce ARCH_32BIT_OFF_T config option
  asm-generic: Drop getrlimit and setrlimit syscalls from default list
  thread: move thread bits accessors to separated file
  arm64: ilp32: add documentation on the ILP32 ABI for ARM64
  arm64: rename functions that reference compat term
  arm64: introduce is_a32_task and is_a32_thread (for AArch32 compat)
  arm64: ilp32: add is_ilp32_compat_{task,thread} and TIF_32BIT_AARCH64
  arm64: introduce binfmt_elf32.c
  arm64: change compat_elf_hwcap and compat_elf_hwcap2 prefix to a32
  arm64: ilp32: introduce binfmt_ilp32.c
  arm64: ilp32: share aarch32 syscall handlers
  arm64: signal: share lp64 signal structures and routines to ilp32
  arm64: signal32: move ilp32 and aarch32 common code to separated file
  arm64: ilp32: introduce ilp32-specific sigframe and ucontext
  arm64: ptrace: handle ptrace_request differently for aarch32 and ilp32

 Documentation/arm64/ilp32.txt                 |  45 +++
 arch/Kconfig                                  |  15 +
 arch/arc/Kconfig                              |   1 +
 arch/arc/include/uapi/asm/unistd.h            |   1 +
 arch/arm/Kconfig                              |   1 +
 arch/arm64/Kconfig                            |  18 +-
 arch/arm64/Makefile                           |   3 +
 arch/arm64/include/asm/compat.h               |  19 +-
 arch/arm64/include/asm/elf.h                  |  36 +-
 arch/arm64/include/asm/fpsimd.h               |   2 +-
 arch/arm64/include/asm/ftrace.h               |   2 +-
 arch/arm64/include/asm/hwcap.h                |   8 +-
 arch/arm64/include/asm/is_compat.h            |  78 ++++
 arch/arm64/include/asm/processor.h            |  15 +-
 arch/arm64/include/asm/ptrace.h               |  12 +-
 arch/arm64/include/asm/seccomp.h              |   2 +-
 arch/arm64/include/asm/signal32.h             |  19 +-
 arch/arm64/include/asm/signal32_common.h      |  13 +
 arch/arm64/include/asm/signal_common.h        | 306 +++++++++++++++
 arch/arm64/include/asm/signal_ilp32.h         |  23 ++
 arch/arm64/include/asm/syscall.h              |   2 +-
 arch/arm64/include/asm/thread_info.h          |   4 +-
 arch/arm64/include/asm/unistd.h               |   6 +-
 arch/arm64/include/asm/vdso.h                 |   6 +
 arch/arm64/include/uapi/asm/bitsperlong.h     |   9 +-
 arch/arm64/include/uapi/asm/unistd.h          |  13 +
 arch/arm64/kernel/Makefile                    |   8 +-
 arch/arm64/kernel/armv8_deprecated.c          |   6 +-
 arch/arm64/kernel/asm-offsets.c               |   9 +-
 arch/arm64/kernel/binfmt_elf32.c              |  35 ++
 arch/arm64/kernel/binfmt_ilp32.c              |  87 +++++
 arch/arm64/kernel/cpufeature.c                |  28 +-
 arch/arm64/kernel/cpuinfo.c                   |  18 +-
 arch/arm64/kernel/debug-monitors.c            |   4 +-
 arch/arm64/kernel/entry.S                     |  37 +-
 arch/arm64/kernel/entry32.S                   |  80 ----
 arch/arm64/kernel/entry32_common.S            |  97 +++++
 arch/arm64/kernel/entry_ilp32.S               |  12 +
 arch/arm64/kernel/head.S                      |   2 +-
 arch/arm64/kernel/hw_breakpoint.c             |   8 +-
 arch/arm64/kernel/perf_callchain.c            |  28 +-
 arch/arm64/kernel/perf_regs.c                 |   4 +-
 arch/arm64/kernel/process.c                   |  11 +-
 arch/arm64/kernel/ptrace.c                    |  36 +-
 arch/arm64/kernel/signal.c                    | 352 +++---------------
 arch/arm64/kernel/signal32.c                  | 111 +++---
 arch/arm64/kernel/signal32_common.c           |  37 ++
 arch/arm64/kernel/signal_ilp32.c              |  65 ++++
 arch/arm64/kernel/sys_compat.c                |  10 +-
 arch/arm64/kernel/sys_ilp32.c                 |  90 +++++
 arch/arm64/kernel/traps.c                     |  11 +-
 arch/arm64/kernel/vdso-ilp32/.gitignore       |   2 +
 arch/arm64/kernel/vdso-ilp32/Makefile         |  82 ++++
 arch/arm64/kernel/vdso-ilp32/vdso-ilp32.S     |  22 ++
 arch/arm64/kernel/vdso-ilp32/vdso-ilp32.lds.S |  84 +++++
 arch/arm64/kernel/vdso.c                      |  65 +++-
 arch/arm64/kernel/vdso/gettimeofday.S         |  20 +-
 arch/arm64/kernel/vdso/vdso.S                 |   6 +-
 arch/arm64/mm/mmap.c                          |   2 +-
 arch/blackfin/Kconfig                         |   1 +
 arch/c6x/include/uapi/asm/unistd.h            |   1 +
 arch/cris/Kconfig                             |   1 +
 arch/frv/Kconfig                              |   1 +
 arch/h8300/Kconfig                            |   1 +
 arch/h8300/include/uapi/asm/unistd.h          |   1 +
 arch/hexagon/Kconfig                          |   1 +
 arch/hexagon/include/uapi/asm/unistd.h        |   1 +
 arch/m32r/Kconfig                             |   1 +
 arch/m68k/Kconfig                             |   1 +
 arch/metag/Kconfig                            |   1 +
 arch/metag/include/uapi/asm/unistd.h          |   1 +
 arch/microblaze/Kconfig                       |   1 +
 arch/mips/Kconfig                             |   1 +
 arch/mn10300/Kconfig                          |   1 +
 arch/nios2/Kconfig                            |   1 +
 arch/nios2/include/uapi/asm/unistd.h          |   1 +
 arch/openrisc/Kconfig                         |   1 +
 arch/openrisc/include/uapi/asm/unistd.h       |   1 +
 arch/parisc/Kconfig                           |   1 +
 arch/powerpc/Kconfig                          |   1 +
 arch/score/Kconfig                            |   1 +
 arch/score/include/uapi/asm/unistd.h          |   1 +
 arch/sh/Kconfig                               |   1 +
 arch/sparc/Kconfig                            |   1 +
 arch/tile/Kconfig                             |   1 +
 arch/tile/include/uapi/asm/unistd.h           |   1 +
 arch/tile/kernel/compat.c                     |   3 +
 arch/unicore32/Kconfig                        |   1 +
 arch/unicore32/include/uapi/asm/unistd.h      |   1 +
 arch/x86/Kconfig                              |   1 +
 arch/x86/um/Kconfig                           |   1 +
 arch/xtensa/Kconfig                           |   1 +
 drivers/clocksource/arm_arch_timer.c          |   4 +-
 include/linux/fcntl.h                         |   2 +-
 include/linux/sched.h                         |   1 +
 include/linux/thread_bits.h                   |  76 ++++
 include/linux/thread_info.h                   |  64 +---
 include/uapi/asm-generic/unistd.h             |  10 +-
 kernel/ptrace.c                               |  48 ++-
 scripts/checksyscalls.sh                      |   5 +
 100 files changed, 1675 insertions(+), 698 deletions(-)
 create mode 100644 Documentation/arm64/ilp32.txt
 create mode 100644 arch/arm64/include/asm/is_compat.h
 create mode 100644 arch/arm64/include/asm/signal32_common.h
 create mode 100644 arch/arm64/include/asm/signal_common.h
 create mode 100644 arch/arm64/include/asm/signal_ilp32.h
 create mode 100644 arch/arm64/kernel/binfmt_elf32.c
 create mode 100644 arch/arm64/kernel/binfmt_ilp32.c
 create mode 100644 arch/arm64/kernel/entry32_common.S
 create mode 100644 arch/arm64/kernel/entry_ilp32.S
 create mode 100644 arch/arm64/kernel/signal32_common.c
 create mode 100644 arch/arm64/kernel/signal_ilp32.c
 create mode 100644 arch/arm64/kernel/sys_ilp32.c
 create mode 100644 arch/arm64/kernel/vdso-ilp32/.gitignore
 create mode 100644 arch/arm64/kernel/vdso-ilp32/Makefile
 create mode 100644 arch/arm64/kernel/vdso-ilp32/vdso-ilp32.S
 create mode 100644 arch/arm64/kernel/vdso-ilp32/vdso-ilp32.lds.S
 create mode 100644 include/linux/thread_bits.h

-- 
2.17.0


^ permalink raw reply	[flat|nested] 104+ messages in thread

* [PATCH v9 00/24] ILP32 for ARM64
@ 2018-05-15 19:11 ` Yury Norov
  0 siblings, 0 replies; 104+ messages in thread
From: Yury Norov @ 2018-05-15 19:11 UTC (permalink / raw)
  To: Catalin Marinas, Arnd Bergmann, linux-arm-kernel, linux-kernel,
	linux-doc, linux-arch, linux-api
  Cc: Yury Norov, Adam Borowski, Alexander Graf, Alexey Klimov,
	Andreas Schwab, Andrew Pinski, Bamvor Zhangjian, Chris Metcalf,
	Christoph Muellner, Dave Martin, David S . Miller,
	Florian Weimer, Geert Uytterhoeven, Heiko Carstens, James Hogan,
	James Morse, Joseph Myers, Lin Yongting, Manuel Montezelo,
	Mark Brown, Martin Schwidefsky, Maxim Kuvyrkov, Nathan_Lynch,
	Philipp Tomsich, Prasun Kapoor, Ramana Radhakrishnan,
	Steve Ellcey, Szabolcs Nagy, Zhou Chengming

This series enables AARCH64 with ILP32 mode.

As supporting work, it introduces ARCH_32BIT_OFF_T configuration
option that is enabled for existing 32-bit architectures but disabled
for new arches (so 64-bit off_t userspace type is used by new userspace).
Also it deprecates getrlimit and setrlimit syscalls prior to prlimit64.

Based on kernel v4.16. Tested with LTP, glibc testsuite, trinity, lmbench,
CPUSpec.

This series on github: 
https://github.com/norov/linux/tree/ilp32-4.16
Linaro toolchain:
http://snapshots.linaro.org/components/toolchain/binaries/7.3-2018.04-rc1/aarch64-linux-gnu_ilp32/
Debian repo:
http://people.linaro.org/~wookey/ilp32/
OpenSUSE repo:
https://build.opensuse.org/project/show/devel:ARM:Factory:Contrib:ILP32

Changes:
v3: https://lkml.org/lkml/2014/9/3/704
v4: https://lkml.org/lkml/2015/4/13/691
v5: https://lkml.org/lkml/2015/9/29/911
v6: https://lkml.org/lkml/2016/5/23/661
v7: https://lkml.org/lkml/2017/1/9/213
v8: https://lkml.org/lkml/2017/6/19/624
v9: - rebased on top of v4.16;
    - signal subsystem reworked to avoid code duplication, as requested
      by Dave Martin (patches 18 and 20);
    - new files introduced in series use SPDX notation for license;
    - linux-api and linux-arch CCed as the series changes kernel ABI;
    - checkpatch and other minor fixes.

Andrew Pinski (4):
  arm64: rename COMPAT to AARCH32_EL0 in Kconfig
  arm64:uapi: set __BITS_PER_LONG correctly for ILP32 and LP64
  arm64: ilp32: add sys_ilp32.c and a separate table (in entry.S) to use
    it
  arm64:ilp32: add ARM64_ILP32 to Kconfig

Catalin Marinas (1):
  arm64: ilp32: Make the Kconfig option default y

Dave Martin (1):
  arm64: signal: Make parse_user_sigframe() independent of rt_sigframe
    layout

James Morse (1):
  ptrace: Add compat PTRACE_{G,S}ETSIGMASK handlers

Philipp Tomsich (1):
  arm64:ilp32: add vdso-ilp32 and use for signal return

Yury Norov (16):
  compat ABI: use non-compat openat and open_by_handle_at variants
  32-bit userspace ABI: introduce ARCH_32BIT_OFF_T config option
  asm-generic: Drop getrlimit and setrlimit syscalls from default list
  thread: move thread bits accessors to separated file
  arm64: ilp32: add documentation on the ILP32 ABI for ARM64
  arm64: rename functions that reference compat term
  arm64: introduce is_a32_task and is_a32_thread (for AArch32 compat)
  arm64: ilp32: add is_ilp32_compat_{task,thread} and TIF_32BIT_AARCH64
  arm64: introduce binfmt_elf32.c
  arm64: change compat_elf_hwcap and compat_elf_hwcap2 prefix to a32
  arm64: ilp32: introduce binfmt_ilp32.c
  arm64: ilp32: share aarch32 syscall handlers
  arm64: signal: share lp64 signal structures and routines to ilp32
  arm64: signal32: move ilp32 and aarch32 common code to separated file
  arm64: ilp32: introduce ilp32-specific sigframe and ucontext
  arm64: ptrace: handle ptrace_request differently for aarch32 and ilp32

 Documentation/arm64/ilp32.txt                 |  45 +++
 arch/Kconfig                                  |  15 +
 arch/arc/Kconfig                              |   1 +
 arch/arc/include/uapi/asm/unistd.h            |   1 +
 arch/arm/Kconfig                              |   1 +
 arch/arm64/Kconfig                            |  18 +-
 arch/arm64/Makefile                           |   3 +
 arch/arm64/include/asm/compat.h               |  19 +-
 arch/arm64/include/asm/elf.h                  |  36 +-
 arch/arm64/include/asm/fpsimd.h               |   2 +-
 arch/arm64/include/asm/ftrace.h               |   2 +-
 arch/arm64/include/asm/hwcap.h                |   8 +-
 arch/arm64/include/asm/is_compat.h            |  78 ++++
 arch/arm64/include/asm/processor.h            |  15 +-
 arch/arm64/include/asm/ptrace.h               |  12 +-
 arch/arm64/include/asm/seccomp.h              |   2 +-
 arch/arm64/include/asm/signal32.h             |  19 +-
 arch/arm64/include/asm/signal32_common.h      |  13 +
 arch/arm64/include/asm/signal_common.h        | 306 +++++++++++++++
 arch/arm64/include/asm/signal_ilp32.h         |  23 ++
 arch/arm64/include/asm/syscall.h              |   2 +-
 arch/arm64/include/asm/thread_info.h          |   4 +-
 arch/arm64/include/asm/unistd.h               |   6 +-
 arch/arm64/include/asm/vdso.h                 |   6 +
 arch/arm64/include/uapi/asm/bitsperlong.h     |   9 +-
 arch/arm64/include/uapi/asm/unistd.h          |  13 +
 arch/arm64/kernel/Makefile                    |   8 +-
 arch/arm64/kernel/armv8_deprecated.c          |   6 +-
 arch/arm64/kernel/asm-offsets.c               |   9 +-
 arch/arm64/kernel/binfmt_elf32.c              |  35 ++
 arch/arm64/kernel/binfmt_ilp32.c              |  87 +++++
 arch/arm64/kernel/cpufeature.c                |  28 +-
 arch/arm64/kernel/cpuinfo.c                   |  18 +-
 arch/arm64/kernel/debug-monitors.c            |   4 +-
 arch/arm64/kernel/entry.S                     |  37 +-
 arch/arm64/kernel/entry32.S                   |  80 ----
 arch/arm64/kernel/entry32_common.S            |  97 +++++
 arch/arm64/kernel/entry_ilp32.S               |  12 +
 arch/arm64/kernel/head.S                      |   2 +-
 arch/arm64/kernel/hw_breakpoint.c             |   8 +-
 arch/arm64/kernel/perf_callchain.c            |  28 +-
 arch/arm64/kernel/perf_regs.c                 |   4 +-
 arch/arm64/kernel/process.c                   |  11 +-
 arch/arm64/kernel/ptrace.c                    |  36 +-
 arch/arm64/kernel/signal.c                    | 352 +++---------------
 arch/arm64/kernel/signal32.c                  | 111 +++---
 arch/arm64/kernel/signal32_common.c           |  37 ++
 arch/arm64/kernel/signal_ilp32.c              |  65 ++++
 arch/arm64/kernel/sys_compat.c                |  10 +-
 arch/arm64/kernel/sys_ilp32.c                 |  90 +++++
 arch/arm64/kernel/traps.c                     |  11 +-
 arch/arm64/kernel/vdso-ilp32/.gitignore       |   2 +
 arch/arm64/kernel/vdso-ilp32/Makefile         |  82 ++++
 arch/arm64/kernel/vdso-ilp32/vdso-ilp32.S     |  22 ++
 arch/arm64/kernel/vdso-ilp32/vdso-ilp32.lds.S |  84 +++++
 arch/arm64/kernel/vdso.c                      |  65 +++-
 arch/arm64/kernel/vdso/gettimeofday.S         |  20 +-
 arch/arm64/kernel/vdso/vdso.S                 |   6 +-
 arch/arm64/mm/mmap.c                          |   2 +-
 arch/blackfin/Kconfig                         |   1 +
 arch/c6x/include/uapi/asm/unistd.h            |   1 +
 arch/cris/Kconfig                             |   1 +
 arch/frv/Kconfig                              |   1 +
 arch/h8300/Kconfig                            |   1 +
 arch/h8300/include/uapi/asm/unistd.h          |   1 +
 arch/hexagon/Kconfig                          |   1 +
 arch/hexagon/include/uapi/asm/unistd.h        |   1 +
 arch/m32r/Kconfig                             |   1 +
 arch/m68k/Kconfig                             |   1 +
 arch/metag/Kconfig                            |   1 +
 arch/metag/include/uapi/asm/unistd.h          |   1 +
 arch/microblaze/Kconfig                       |   1 +
 arch/mips/Kconfig                             |   1 +
 arch/mn10300/Kconfig                          |   1 +
 arch/nios2/Kconfig                            |   1 +
 arch/nios2/include/uapi/asm/unistd.h          |   1 +
 arch/openrisc/Kconfig                         |   1 +
 arch/openrisc/include/uapi/asm/unistd.h       |   1 +
 arch/parisc/Kconfig                           |   1 +
 arch/powerpc/Kconfig                          |   1 +
 arch/score/Kconfig                            |   1 +
 arch/score/include/uapi/asm/unistd.h          |   1 +
 arch/sh/Kconfig                               |   1 +
 arch/sparc/Kconfig                            |   1 +
 arch/tile/Kconfig                             |   1 +
 arch/tile/include/uapi/asm/unistd.h           |   1 +
 arch/tile/kernel/compat.c                     |   3 +
 arch/unicore32/Kconfig                        |   1 +
 arch/unicore32/include/uapi/asm/unistd.h      |   1 +
 arch/x86/Kconfig                              |   1 +
 arch/x86/um/Kconfig                           |   1 +
 arch/xtensa/Kconfig                           |   1 +
 drivers/clocksource/arm_arch_timer.c          |   4 +-
 include/linux/fcntl.h                         |   2 +-
 include/linux/sched.h                         |   1 +
 include/linux/thread_bits.h                   |  76 ++++
 include/linux/thread_info.h                   |  64 +---
 include/uapi/asm-generic/unistd.h             |  10 +-
 kernel/ptrace.c                               |  48 ++-
 scripts/checksyscalls.sh                      |   5 +
 100 files changed, 1675 insertions(+), 698 deletions(-)
 create mode 100644 Documentation/arm64/ilp32.txt
 create mode 100644 arch/arm64/include/asm/is_compat.h
 create mode 100644 arch/arm64/include/asm/signal32_common.h
 create mode 100644 arch/arm64/include/asm/signal_common.h
 create mode 100644 arch/arm64/include/asm/signal_ilp32.h
 create mode 100644 arch/arm64/kernel/binfmt_elf32.c
 create mode 100644 arch/arm64/kernel/binfmt_ilp32.c
 create mode 100644 arch/arm64/kernel/entry32_common.S
 create mode 100644 arch/arm64/kernel/entry_ilp32.S
 create mode 100644 arch/arm64/kernel/signal32_common.c
 create mode 100644 arch/arm64/kernel/signal_ilp32.c
 create mode 100644 arch/arm64/kernel/sys_ilp32.c
 create mode 100644 arch/arm64/kernel/vdso-ilp32/.gitignore
 create mode 100644 arch/arm64/kernel/vdso-ilp32/Makefile
 create mode 100644 arch/arm64/kernel/vdso-ilp32/vdso-ilp32.S
 create mode 100644 arch/arm64/kernel/vdso-ilp32/vdso-ilp32.lds.S
 create mode 100644 include/linux/thread_bits.h

-- 
2.17.0

--
To unsubscribe from this list: send the line "unsubscribe linux-doc" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 104+ messages in thread

* [PATCH v9 00/24] ILP32 for ARM64
@ 2018-05-15 19:11 ` Yury Norov
  0 siblings, 0 replies; 104+ messages in thread
From: Yury Norov @ 2018-05-15 19:11 UTC (permalink / raw)
  To: Catalin Marinas, Arnd Bergmann, linux-arm-kernel, linux-kernel,
	linux-doc, linux-arch, linux-api
  Cc: Yury Norov, Adam Borowski, Alexander Graf, Alexey Klimov,
	Andreas Schwab, Andrew Pinski, Bamvor Zhangjian, Chris Metcalf,
	Christoph Muellner, Dave Martin, David S . Miller,
	Florian Weimer, Geert Uytterhoeven, Heiko Carstens, James Hogan,
	James Morse, Joseph Myers, Lin Yongting, Manuel Montezelo

This series enables AARCH64 with ILP32 mode.

As supporting work, it introduces ARCH_32BIT_OFF_T configuration
option that is enabled for existing 32-bit architectures but disabled
for new arches (so 64-bit off_t userspace type is used by new userspace).
Also it deprecates getrlimit and setrlimit syscalls prior to prlimit64.

Based on kernel v4.16. Tested with LTP, glibc testsuite, trinity, lmbench,
CPUSpec.

This series on github: 
https://github.com/norov/linux/tree/ilp32-4.16
Linaro toolchain:
http://snapshots.linaro.org/components/toolchain/binaries/7.3-2018.04-rc1/aarch64-linux-gnu_ilp32/
Debian repo:
http://people.linaro.org/~wookey/ilp32/
OpenSUSE repo:
https://build.opensuse.org/project/show/devel:ARM:Factory:Contrib:ILP32

Changes:
v3: https://lkml.org/lkml/2014/9/3/704
v4: https://lkml.org/lkml/2015/4/13/691
v5: https://lkml.org/lkml/2015/9/29/911
v6: https://lkml.org/lkml/2016/5/23/661
v7: https://lkml.org/lkml/2017/1/9/213
v8: https://lkml.org/lkml/2017/6/19/624
v9: - rebased on top of v4.16;
    - signal subsystem reworked to avoid code duplication, as requested
      by Dave Martin (patches 18 and 20);
    - new files introduced in series use SPDX notation for license;
    - linux-api and linux-arch CCed as the series changes kernel ABI;
    - checkpatch and other minor fixes.

Andrew Pinski (4):
  arm64: rename COMPAT to AARCH32_EL0 in Kconfig
  arm64:uapi: set __BITS_PER_LONG correctly for ILP32 and LP64
  arm64: ilp32: add sys_ilp32.c and a separate table (in entry.S) to use
    it
  arm64:ilp32: add ARM64_ILP32 to Kconfig

Catalin Marinas (1):
  arm64: ilp32: Make the Kconfig option default y

Dave Martin (1):
  arm64: signal: Make parse_user_sigframe() independent of rt_sigframe
    layout

James Morse (1):
  ptrace: Add compat PTRACE_{G,S}ETSIGMASK handlers

Philipp Tomsich (1):
  arm64:ilp32: add vdso-ilp32 and use for signal return

Yury Norov (16):
  compat ABI: use non-compat openat and open_by_handle_at variants
  32-bit userspace ABI: introduce ARCH_32BIT_OFF_T config option
  asm-generic: Drop getrlimit and setrlimit syscalls from default list
  thread: move thread bits accessors to separated file
  arm64: ilp32: add documentation on the ILP32 ABI for ARM64
  arm64: rename functions that reference compat term
  arm64: introduce is_a32_task and is_a32_thread (for AArch32 compat)
  arm64: ilp32: add is_ilp32_compat_{task,thread} and TIF_32BIT_AARCH64
  arm64: introduce binfmt_elf32.c
  arm64: change compat_elf_hwcap and compat_elf_hwcap2 prefix to a32
  arm64: ilp32: introduce binfmt_ilp32.c
  arm64: ilp32: share aarch32 syscall handlers
  arm64: signal: share lp64 signal structures and routines to ilp32
  arm64: signal32: move ilp32 and aarch32 common code to separated file
  arm64: ilp32: introduce ilp32-specific sigframe and ucontext
  arm64: ptrace: handle ptrace_request differently for aarch32 and ilp32

 Documentation/arm64/ilp32.txt                 |  45 +++
 arch/Kconfig                                  |  15 +
 arch/arc/Kconfig                              |   1 +
 arch/arc/include/uapi/asm/unistd.h            |   1 +
 arch/arm/Kconfig                              |   1 +
 arch/arm64/Kconfig                            |  18 +-
 arch/arm64/Makefile                           |   3 +
 arch/arm64/include/asm/compat.h               |  19 +-
 arch/arm64/include/asm/elf.h                  |  36 +-
 arch/arm64/include/asm/fpsimd.h               |   2 +-
 arch/arm64/include/asm/ftrace.h               |   2 +-
 arch/arm64/include/asm/hwcap.h                |   8 +-
 arch/arm64/include/asm/is_compat.h            |  78 ++++
 arch/arm64/include/asm/processor.h            |  15 +-
 arch/arm64/include/asm/ptrace.h               |  12 +-
 arch/arm64/include/asm/seccomp.h              |   2 +-
 arch/arm64/include/asm/signal32.h             |  19 +-
 arch/arm64/include/asm/signal32_common.h      |  13 +
 arch/arm64/include/asm/signal_common.h        | 306 +++++++++++++++
 arch/arm64/include/asm/signal_ilp32.h         |  23 ++
 arch/arm64/include/asm/syscall.h              |   2 +-
 arch/arm64/include/asm/thread_info.h          |   4 +-
 arch/arm64/include/asm/unistd.h               |   6 +-
 arch/arm64/include/asm/vdso.h                 |   6 +
 arch/arm64/include/uapi/asm/bitsperlong.h     |   9 +-
 arch/arm64/include/uapi/asm/unistd.h          |  13 +
 arch/arm64/kernel/Makefile                    |   8 +-
 arch/arm64/kernel/armv8_deprecated.c          |   6 +-
 arch/arm64/kernel/asm-offsets.c               |   9 +-
 arch/arm64/kernel/binfmt_elf32.c              |  35 ++
 arch/arm64/kernel/binfmt_ilp32.c              |  87 +++++
 arch/arm64/kernel/cpufeature.c                |  28 +-
 arch/arm64/kernel/cpuinfo.c                   |  18 +-
 arch/arm64/kernel/debug-monitors.c            |   4 +-
 arch/arm64/kernel/entry.S                     |  37 +-
 arch/arm64/kernel/entry32.S                   |  80 ----
 arch/arm64/kernel/entry32_common.S            |  97 +++++
 arch/arm64/kernel/entry_ilp32.S               |  12 +
 arch/arm64/kernel/head.S                      |   2 +-
 arch/arm64/kernel/hw_breakpoint.c             |   8 +-
 arch/arm64/kernel/perf_callchain.c            |  28 +-
 arch/arm64/kernel/perf_regs.c                 |   4 +-
 arch/arm64/kernel/process.c                   |  11 +-
 arch/arm64/kernel/ptrace.c                    |  36 +-
 arch/arm64/kernel/signal.c                    | 352 +++---------------
 arch/arm64/kernel/signal32.c                  | 111 +++---
 arch/arm64/kernel/signal32_common.c           |  37 ++
 arch/arm64/kernel/signal_ilp32.c              |  65 ++++
 arch/arm64/kernel/sys_compat.c                |  10 +-
 arch/arm64/kernel/sys_ilp32.c                 |  90 +++++
 arch/arm64/kernel/traps.c                     |  11 +-
 arch/arm64/kernel/vdso-ilp32/.gitignore       |   2 +
 arch/arm64/kernel/vdso-ilp32/Makefile         |  82 ++++
 arch/arm64/kernel/vdso-ilp32/vdso-ilp32.S     |  22 ++
 arch/arm64/kernel/vdso-ilp32/vdso-ilp32.lds.S |  84 +++++
 arch/arm64/kernel/vdso.c                      |  65 +++-
 arch/arm64/kernel/vdso/gettimeofday.S         |  20 +-
 arch/arm64/kernel/vdso/vdso.S                 |   6 +-
 arch/arm64/mm/mmap.c                          |   2 +-
 arch/blackfin/Kconfig                         |   1 +
 arch/c6x/include/uapi/asm/unistd.h            |   1 +
 arch/cris/Kconfig                             |   1 +
 arch/frv/Kconfig                              |   1 +
 arch/h8300/Kconfig                            |   1 +
 arch/h8300/include/uapi/asm/unistd.h          |   1 +
 arch/hexagon/Kconfig                          |   1 +
 arch/hexagon/include/uapi/asm/unistd.h        |   1 +
 arch/m32r/Kconfig                             |   1 +
 arch/m68k/Kconfig                             |   1 +
 arch/metag/Kconfig                            |   1 +
 arch/metag/include/uapi/asm/unistd.h          |   1 +
 arch/microblaze/Kconfig                       |   1 +
 arch/mips/Kconfig                             |   1 +
 arch/mn10300/Kconfig                          |   1 +
 arch/nios2/Kconfig                            |   1 +
 arch/nios2/include/uapi/asm/unistd.h          |   1 +
 arch/openrisc/Kconfig                         |   1 +
 arch/openrisc/include/uapi/asm/unistd.h       |   1 +
 arch/parisc/Kconfig                           |   1 +
 arch/powerpc/Kconfig                          |   1 +
 arch/score/Kconfig                            |   1 +
 arch/score/include/uapi/asm/unistd.h          |   1 +
 arch/sh/Kconfig                               |   1 +
 arch/sparc/Kconfig                            |   1 +
 arch/tile/Kconfig                             |   1 +
 arch/tile/include/uapi/asm/unistd.h           |   1 +
 arch/tile/kernel/compat.c                     |   3 +
 arch/unicore32/Kconfig                        |   1 +
 arch/unicore32/include/uapi/asm/unistd.h      |   1 +
 arch/x86/Kconfig                              |   1 +
 arch/x86/um/Kconfig                           |   1 +
 arch/xtensa/Kconfig                           |   1 +
 drivers/clocksource/arm_arch_timer.c          |   4 +-
 include/linux/fcntl.h                         |   2 +-
 include/linux/sched.h                         |   1 +
 include/linux/thread_bits.h                   |  76 ++++
 include/linux/thread_info.h                   |  64 +---
 include/uapi/asm-generic/unistd.h             |  10 +-
 kernel/ptrace.c                               |  48 ++-
 scripts/checksyscalls.sh                      |   5 +
 100 files changed, 1675 insertions(+), 698 deletions(-)
 create mode 100644 Documentation/arm64/ilp32.txt
 create mode 100644 arch/arm64/include/asm/is_compat.h
 create mode 100644 arch/arm64/include/asm/signal32_common.h
 create mode 100644 arch/arm64/include/asm/signal_common.h
 create mode 100644 arch/arm64/include/asm/signal_ilp32.h
 create mode 100644 arch/arm64/kernel/binfmt_elf32.c
 create mode 100644 arch/arm64/kernel/binfmt_ilp32.c
 create mode 100644 arch/arm64/kernel/entry32_common.S
 create mode 100644 arch/arm64/kernel/entry_ilp32.S
 create mode 100644 arch/arm64/kernel/signal32_common.c
 create mode 100644 arch/arm64/kernel/signal_ilp32.c
 create mode 100644 arch/arm64/kernel/sys_ilp32.c
 create mode 100644 arch/arm64/kernel/vdso-ilp32/.gitignore
 create mode 100644 arch/arm64/kernel/vdso-ilp32/Makefile
 create mode 100644 arch/arm64/kernel/vdso-ilp32/vdso-ilp32.S
 create mode 100644 arch/arm64/kernel/vdso-ilp32/vdso-ilp32.lds.S
 create mode 100644 include/linux/thread_bits.h

-- 
2.17.0

^ permalink raw reply	[flat|nested] 104+ messages in thread

* [PATCH v9 00/24] ILP32 for ARM64
@ 2018-05-15 19:11 ` Yury Norov
  0 siblings, 0 replies; 104+ messages in thread
From: Yury Norov @ 2018-05-15 19:11 UTC (permalink / raw)
  To: linux-arm-kernel

This series enables AARCH64 with ILP32 mode.

As supporting work, it introduces ARCH_32BIT_OFF_T configuration
option that is enabled for existing 32-bit architectures but disabled
for new arches (so 64-bit off_t userspace type is used by new userspace).
Also it deprecates getrlimit and setrlimit syscalls prior to prlimit64.

Based on kernel v4.16. Tested with LTP, glibc testsuite, trinity, lmbench,
CPUSpec.

This series on github: 
https://github.com/norov/linux/tree/ilp32-4.16
Linaro toolchain:
http://snapshots.linaro.org/components/toolchain/binaries/7.3-2018.04-rc1/aarch64-linux-gnu_ilp32/
Debian repo:
http://people.linaro.org/~wookey/ilp32/
OpenSUSE repo:
https://build.opensuse.org/project/show/devel:ARM:Factory:Contrib:ILP32

Changes:
v3: https://lkml.org/lkml/2014/9/3/704
v4: https://lkml.org/lkml/2015/4/13/691
v5: https://lkml.org/lkml/2015/9/29/911
v6: https://lkml.org/lkml/2016/5/23/661
v7: https://lkml.org/lkml/2017/1/9/213
v8: https://lkml.org/lkml/2017/6/19/624
v9: - rebased on top of v4.16;
    - signal subsystem reworked to avoid code duplication, as requested
      by Dave Martin (patches 18 and 20);
    - new files introduced in series use SPDX notation for license;
    - linux-api and linux-arch CCed as the series changes kernel ABI;
    - checkpatch and other minor fixes.

Andrew Pinski (4):
  arm64: rename COMPAT to AARCH32_EL0 in Kconfig
  arm64:uapi: set __BITS_PER_LONG correctly for ILP32 and LP64
  arm64: ilp32: add sys_ilp32.c and a separate table (in entry.S) to use
    it
  arm64:ilp32: add ARM64_ILP32 to Kconfig

Catalin Marinas (1):
  arm64: ilp32: Make the Kconfig option default y

Dave Martin (1):
  arm64: signal: Make parse_user_sigframe() independent of rt_sigframe
    layout

James Morse (1):
  ptrace: Add compat PTRACE_{G,S}ETSIGMASK handlers

Philipp Tomsich (1):
  arm64:ilp32: add vdso-ilp32 and use for signal return

Yury Norov (16):
  compat ABI: use non-compat openat and open_by_handle_at variants
  32-bit userspace ABI: introduce ARCH_32BIT_OFF_T config option
  asm-generic: Drop getrlimit and setrlimit syscalls from default list
  thread: move thread bits accessors to separated file
  arm64: ilp32: add documentation on the ILP32 ABI for ARM64
  arm64: rename functions that reference compat term
  arm64: introduce is_a32_task and is_a32_thread (for AArch32 compat)
  arm64: ilp32: add is_ilp32_compat_{task,thread} and TIF_32BIT_AARCH64
  arm64: introduce binfmt_elf32.c
  arm64: change compat_elf_hwcap and compat_elf_hwcap2 prefix to a32
  arm64: ilp32: introduce binfmt_ilp32.c
  arm64: ilp32: share aarch32 syscall handlers
  arm64: signal: share lp64 signal structures and routines to ilp32
  arm64: signal32: move ilp32 and aarch32 common code to separated file
  arm64: ilp32: introduce ilp32-specific sigframe and ucontext
  arm64: ptrace: handle ptrace_request differently for aarch32 and ilp32

 Documentation/arm64/ilp32.txt                 |  45 +++
 arch/Kconfig                                  |  15 +
 arch/arc/Kconfig                              |   1 +
 arch/arc/include/uapi/asm/unistd.h            |   1 +
 arch/arm/Kconfig                              |   1 +
 arch/arm64/Kconfig                            |  18 +-
 arch/arm64/Makefile                           |   3 +
 arch/arm64/include/asm/compat.h               |  19 +-
 arch/arm64/include/asm/elf.h                  |  36 +-
 arch/arm64/include/asm/fpsimd.h               |   2 +-
 arch/arm64/include/asm/ftrace.h               |   2 +-
 arch/arm64/include/asm/hwcap.h                |   8 +-
 arch/arm64/include/asm/is_compat.h            |  78 ++++
 arch/arm64/include/asm/processor.h            |  15 +-
 arch/arm64/include/asm/ptrace.h               |  12 +-
 arch/arm64/include/asm/seccomp.h              |   2 +-
 arch/arm64/include/asm/signal32.h             |  19 +-
 arch/arm64/include/asm/signal32_common.h      |  13 +
 arch/arm64/include/asm/signal_common.h        | 306 +++++++++++++++
 arch/arm64/include/asm/signal_ilp32.h         |  23 ++
 arch/arm64/include/asm/syscall.h              |   2 +-
 arch/arm64/include/asm/thread_info.h          |   4 +-
 arch/arm64/include/asm/unistd.h               |   6 +-
 arch/arm64/include/asm/vdso.h                 |   6 +
 arch/arm64/include/uapi/asm/bitsperlong.h     |   9 +-
 arch/arm64/include/uapi/asm/unistd.h          |  13 +
 arch/arm64/kernel/Makefile                    |   8 +-
 arch/arm64/kernel/armv8_deprecated.c          |   6 +-
 arch/arm64/kernel/asm-offsets.c               |   9 +-
 arch/arm64/kernel/binfmt_elf32.c              |  35 ++
 arch/arm64/kernel/binfmt_ilp32.c              |  87 +++++
 arch/arm64/kernel/cpufeature.c                |  28 +-
 arch/arm64/kernel/cpuinfo.c                   |  18 +-
 arch/arm64/kernel/debug-monitors.c            |   4 +-
 arch/arm64/kernel/entry.S                     |  37 +-
 arch/arm64/kernel/entry32.S                   |  80 ----
 arch/arm64/kernel/entry32_common.S            |  97 +++++
 arch/arm64/kernel/entry_ilp32.S               |  12 +
 arch/arm64/kernel/head.S                      |   2 +-
 arch/arm64/kernel/hw_breakpoint.c             |   8 +-
 arch/arm64/kernel/perf_callchain.c            |  28 +-
 arch/arm64/kernel/perf_regs.c                 |   4 +-
 arch/arm64/kernel/process.c                   |  11 +-
 arch/arm64/kernel/ptrace.c                    |  36 +-
 arch/arm64/kernel/signal.c                    | 352 +++---------------
 arch/arm64/kernel/signal32.c                  | 111 +++---
 arch/arm64/kernel/signal32_common.c           |  37 ++
 arch/arm64/kernel/signal_ilp32.c              |  65 ++++
 arch/arm64/kernel/sys_compat.c                |  10 +-
 arch/arm64/kernel/sys_ilp32.c                 |  90 +++++
 arch/arm64/kernel/traps.c                     |  11 +-
 arch/arm64/kernel/vdso-ilp32/.gitignore       |   2 +
 arch/arm64/kernel/vdso-ilp32/Makefile         |  82 ++++
 arch/arm64/kernel/vdso-ilp32/vdso-ilp32.S     |  22 ++
 arch/arm64/kernel/vdso-ilp32/vdso-ilp32.lds.S |  84 +++++
 arch/arm64/kernel/vdso.c                      |  65 +++-
 arch/arm64/kernel/vdso/gettimeofday.S         |  20 +-
 arch/arm64/kernel/vdso/vdso.S                 |   6 +-
 arch/arm64/mm/mmap.c                          |   2 +-
 arch/blackfin/Kconfig                         |   1 +
 arch/c6x/include/uapi/asm/unistd.h            |   1 +
 arch/cris/Kconfig                             |   1 +
 arch/frv/Kconfig                              |   1 +
 arch/h8300/Kconfig                            |   1 +
 arch/h8300/include/uapi/asm/unistd.h          |   1 +
 arch/hexagon/Kconfig                          |   1 +
 arch/hexagon/include/uapi/asm/unistd.h        |   1 +
 arch/m32r/Kconfig                             |   1 +
 arch/m68k/Kconfig                             |   1 +
 arch/metag/Kconfig                            |   1 +
 arch/metag/include/uapi/asm/unistd.h          |   1 +
 arch/microblaze/Kconfig                       |   1 +
 arch/mips/Kconfig                             |   1 +
 arch/mn10300/Kconfig                          |   1 +
 arch/nios2/Kconfig                            |   1 +
 arch/nios2/include/uapi/asm/unistd.h          |   1 +
 arch/openrisc/Kconfig                         |   1 +
 arch/openrisc/include/uapi/asm/unistd.h       |   1 +
 arch/parisc/Kconfig                           |   1 +
 arch/powerpc/Kconfig                          |   1 +
 arch/score/Kconfig                            |   1 +
 arch/score/include/uapi/asm/unistd.h          |   1 +
 arch/sh/Kconfig                               |   1 +
 arch/sparc/Kconfig                            |   1 +
 arch/tile/Kconfig                             |   1 +
 arch/tile/include/uapi/asm/unistd.h           |   1 +
 arch/tile/kernel/compat.c                     |   3 +
 arch/unicore32/Kconfig                        |   1 +
 arch/unicore32/include/uapi/asm/unistd.h      |   1 +
 arch/x86/Kconfig                              |   1 +
 arch/x86/um/Kconfig                           |   1 +
 arch/xtensa/Kconfig                           |   1 +
 drivers/clocksource/arm_arch_timer.c          |   4 +-
 include/linux/fcntl.h                         |   2 +-
 include/linux/sched.h                         |   1 +
 include/linux/thread_bits.h                   |  76 ++++
 include/linux/thread_info.h                   |  64 +---
 include/uapi/asm-generic/unistd.h             |  10 +-
 kernel/ptrace.c                               |  48 ++-
 scripts/checksyscalls.sh                      |   5 +
 100 files changed, 1675 insertions(+), 698 deletions(-)
 create mode 100644 Documentation/arm64/ilp32.txt
 create mode 100644 arch/arm64/include/asm/is_compat.h
 create mode 100644 arch/arm64/include/asm/signal32_common.h
 create mode 100644 arch/arm64/include/asm/signal_common.h
 create mode 100644 arch/arm64/include/asm/signal_ilp32.h
 create mode 100644 arch/arm64/kernel/binfmt_elf32.c
 create mode 100644 arch/arm64/kernel/binfmt_ilp32.c
 create mode 100644 arch/arm64/kernel/entry32_common.S
 create mode 100644 arch/arm64/kernel/entry_ilp32.S
 create mode 100644 arch/arm64/kernel/signal32_common.c
 create mode 100644 arch/arm64/kernel/signal_ilp32.c
 create mode 100644 arch/arm64/kernel/sys_ilp32.c
 create mode 100644 arch/arm64/kernel/vdso-ilp32/.gitignore
 create mode 100644 arch/arm64/kernel/vdso-ilp32/Makefile
 create mode 100644 arch/arm64/kernel/vdso-ilp32/vdso-ilp32.S
 create mode 100644 arch/arm64/kernel/vdso-ilp32/vdso-ilp32.lds.S
 create mode 100644 include/linux/thread_bits.h

-- 
2.17.0

^ permalink raw reply	[flat|nested] 104+ messages in thread

* [PATCH 01/24] arm64: signal: Make parse_user_sigframe() independent of rt_sigframe layout
  2018-05-15 19:11 ` Yury Norov
  (?)
  (?)
@ 2018-05-15 19:11   ` Yury Norov
  -1 siblings, 0 replies; 104+ messages in thread
From: Yury Norov @ 2018-05-15 19:11 UTC (permalink / raw)
  To: Catalin Marinas, Arnd Bergmann, linux-arm-kernel, linux-kernel,
	linux-doc, linux-arch, linux-api
  Cc: Yury Norov, Adam Borowski, Alexander Graf, Alexey Klimov,
	Andreas Schwab, Andrew Pinski, Bamvor Zhangjian, Chris Metcalf,
	Christoph Muellner, Dave Martin, David S . Miller,
	Florian Weimer, Geert Uytterhoeven, Heiko Carstens, James Hogan,
	James Morse, Joseph Myers, Lin Yongting, Manuel Montezelo,
	Mark Brown, Martin Schwidefsky, Maxim Kuvyrkov, Nathan_Lynch,
	Philipp Tomsich, Prasun Kapoor, Ramana Radhakrishnan,
	Steve Ellcey, Szabolcs Nagy, Zhou Chengming

From: Dave Martin <Dave.Martin@arm.com>

ILP32 uses the same struct sigcontext as the native ABI (i.e.,
LP64), but a different layout for the rest of the signal frame (since
siginfo_t and ucontext_t are both ABI-dependent).

Since the purpose of parse_user_sigframe() is really to parse sigcontext
and not the whole signal frame, the function does not need to depend
on the layout of rt_sigframe -- the only purpose of the rt_sigframe
pointer is for use as a base to measure the signal frame size.

So, this patch renames the function to make it clear that only the
sigcontext is really being parsed, and makes the sigframe base pointer
generic.  A macro is defined to provide a suitable duck-typed interface
that can be used with both sigframe definitions.

Suggested-by: Yury Norov <ynorov@caviumnetworks.com>
Signed-off-by: Dave Martin <Dave.Martin@arm.com>
Signed-off-by: Yury Norov <ynorov@caviumnetworks.com>
---
 arch/arm64/kernel/signal.c | 14 ++++++++------
 1 file changed, 8 insertions(+), 6 deletions(-)

diff --git a/arch/arm64/kernel/signal.c b/arch/arm64/kernel/signal.c
index f60c052e8d1c..65406218743c 100644
--- a/arch/arm64/kernel/signal.c
+++ b/arch/arm64/kernel/signal.c
@@ -334,17 +334,16 @@ extern int restore_sve_fpsimd_context(struct user_ctxs *user);
 
 #endif /* ! CONFIG_ARM64_SVE */
 
-
-static int parse_user_sigframe(struct user_ctxs *user,
-			       struct rt_sigframe __user *sf)
+static int __parse_user_sigcontext(struct user_ctxs *user,
+				   struct sigcontext __user const *sc,
+				   void __user const *sigframe_base)
 {
-	struct sigcontext __user *const sc = &sf->uc.uc_mcontext;
 	struct _aarch64_ctx __user *head;
 	char __user *base = (char __user *)&sc->__reserved;
 	size_t offset = 0;
 	size_t limit = sizeof(sc->__reserved);
 	bool have_extra_context = false;
-	char const __user *const sfp = (char const __user *)sf;
+	char const __user *const sfp = (char const __user *)sigframe_base;
 
 	user->fpsimd = NULL;
 	user->sve = NULL;
@@ -493,6 +492,9 @@ static int parse_user_sigframe(struct user_ctxs *user,
 	return -EINVAL;
 }
 
+#define parse_user_sigcontext(user, sf)					\
+	__parse_user_sigcontext(user, &(sf)->uc.uc_mcontext, sf)
+
 static int restore_sigframe(struct pt_regs *regs,
 			    struct rt_sigframe __user *sf)
 {
@@ -518,7 +520,7 @@ static int restore_sigframe(struct pt_regs *regs,
 
 	err |= !valid_user_regs(&regs->user_regs, current);
 	if (err == 0)
-		err = parse_user_sigframe(&user, sf);
+		err = parse_user_sigcontext(&user, sf);
 
 	if (err == 0) {
 		if (!user.fpsimd)
-- 
2.17.0


^ permalink raw reply related	[flat|nested] 104+ messages in thread

* [PATCH 01/24] arm64: signal: Make parse_user_sigframe() independent of rt_sigframe layout
@ 2018-05-15 19:11   ` Yury Norov
  0 siblings, 0 replies; 104+ messages in thread
From: Yury Norov @ 2018-05-15 19:11 UTC (permalink / raw)
  To: Catalin Marinas, Arnd Bergmann, linux-arm-kernel, linux-kernel,
	linux-doc, linux-arch, linux-api
  Cc: Yury Norov, Adam Borowski, Alexander Graf, Alexey Klimov,
	Andreas Schwab, Andrew Pinski, Bamvor Zhangjian, Chris Metcalf,
	Christoph Muellner, Dave Martin, David S . Miller,
	Florian Weimer, Geert Uytterhoeven, Heiko Carstens, James Hogan,
	James Morse, Joseph Myers, Lin Yongting, Manuel Montezelo,
	Mark Brown, Martin Schwidefsky, Maxim Kuvyrkov, Nathan_Lynch,
	Philipp Tomsich, Prasun Kapoor, Ramana Radhakrishnan,
	Steve Ellcey, Szabolcs Nagy, Zhou Chengming

From: Dave Martin <Dave.Martin@arm.com>

ILP32 uses the same struct sigcontext as the native ABI (i.e.,
LP64), but a different layout for the rest of the signal frame (since
siginfo_t and ucontext_t are both ABI-dependent).

Since the purpose of parse_user_sigframe() is really to parse sigcontext
and not the whole signal frame, the function does not need to depend
on the layout of rt_sigframe -- the only purpose of the rt_sigframe
pointer is for use as a base to measure the signal frame size.

So, this patch renames the function to make it clear that only the
sigcontext is really being parsed, and makes the sigframe base pointer
generic.  A macro is defined to provide a suitable duck-typed interface
that can be used with both sigframe definitions.

Suggested-by: Yury Norov <ynorov@caviumnetworks.com>
Signed-off-by: Dave Martin <Dave.Martin@arm.com>
Signed-off-by: Yury Norov <ynorov@caviumnetworks.com>
---
 arch/arm64/kernel/signal.c | 14 ++++++++------
 1 file changed, 8 insertions(+), 6 deletions(-)

diff --git a/arch/arm64/kernel/signal.c b/arch/arm64/kernel/signal.c
index f60c052e8d1c..65406218743c 100644
--- a/arch/arm64/kernel/signal.c
+++ b/arch/arm64/kernel/signal.c
@@ -334,17 +334,16 @@ extern int restore_sve_fpsimd_context(struct user_ctxs *user);
 
 #endif /* ! CONFIG_ARM64_SVE */
 
-
-static int parse_user_sigframe(struct user_ctxs *user,
-			       struct rt_sigframe __user *sf)
+static int __parse_user_sigcontext(struct user_ctxs *user,
+				   struct sigcontext __user const *sc,
+				   void __user const *sigframe_base)
 {
-	struct sigcontext __user *const sc = &sf->uc.uc_mcontext;
 	struct _aarch64_ctx __user *head;
 	char __user *base = (char __user *)&sc->__reserved;
 	size_t offset = 0;
 	size_t limit = sizeof(sc->__reserved);
 	bool have_extra_context = false;
-	char const __user *const sfp = (char const __user *)sf;
+	char const __user *const sfp = (char const __user *)sigframe_base;
 
 	user->fpsimd = NULL;
 	user->sve = NULL;
@@ -493,6 +492,9 @@ static int parse_user_sigframe(struct user_ctxs *user,
 	return -EINVAL;
 }
 
+#define parse_user_sigcontext(user, sf)					\
+	__parse_user_sigcontext(user, &(sf)->uc.uc_mcontext, sf)
+
 static int restore_sigframe(struct pt_regs *regs,
 			    struct rt_sigframe __user *sf)
 {
@@ -518,7 +520,7 @@ static int restore_sigframe(struct pt_regs *regs,
 
 	err |= !valid_user_regs(&regs->user_regs, current);
 	if (err == 0)
-		err = parse_user_sigframe(&user, sf);
+		err = parse_user_sigcontext(&user, sf);
 
 	if (err == 0) {
 		if (!user.fpsimd)
-- 
2.17.0

--
To unsubscribe from this list: send the line "unsubscribe linux-doc" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply related	[flat|nested] 104+ messages in thread

* [PATCH 01/24] arm64: signal: Make parse_user_sigframe() independent of rt_sigframe layout
@ 2018-05-15 19:11   ` Yury Norov
  0 siblings, 0 replies; 104+ messages in thread
From: Yury Norov @ 2018-05-15 19:11 UTC (permalink / raw)
  To: Catalin Marinas, Arnd Bergmann, linux-arm-kernel, linux-kernel,
	linux-doc, linux-arch, linux-api
  Cc: Yury Norov, Adam Borowski, Alexander Graf, Alexey Klimov,
	Andreas Schwab, Andrew Pinski, Bamvor Zhangjian, Chris Metcalf,
	Christoph Muellner, Dave Martin, David S . Miller,
	Florian Weimer, Geert Uytterhoeven, Heiko Carstens, James Hogan,
	James Morse, Joseph Myers, Lin Yongting, Manuel Montezelo

From: Dave Martin <Dave.Martin@arm.com>

ILP32 uses the same struct sigcontext as the native ABI (i.e.,
LP64), but a different layout for the rest of the signal frame (since
siginfo_t and ucontext_t are both ABI-dependent).

Since the purpose of parse_user_sigframe() is really to parse sigcontext
and not the whole signal frame, the function does not need to depend
on the layout of rt_sigframe -- the only purpose of the rt_sigframe
pointer is for use as a base to measure the signal frame size.

So, this patch renames the function to make it clear that only the
sigcontext is really being parsed, and makes the sigframe base pointer
generic.  A macro is defined to provide a suitable duck-typed interface
that can be used with both sigframe definitions.

Suggested-by: Yury Norov <ynorov@caviumnetworks.com>
Signed-off-by: Dave Martin <Dave.Martin@arm.com>
Signed-off-by: Yury Norov <ynorov@caviumnetworks.com>
---
 arch/arm64/kernel/signal.c | 14 ++++++++------
 1 file changed, 8 insertions(+), 6 deletions(-)

diff --git a/arch/arm64/kernel/signal.c b/arch/arm64/kernel/signal.c
index f60c052e8d1c..65406218743c 100644
--- a/arch/arm64/kernel/signal.c
+++ b/arch/arm64/kernel/signal.c
@@ -334,17 +334,16 @@ extern int restore_sve_fpsimd_context(struct user_ctxs *user);
 
 #endif /* ! CONFIG_ARM64_SVE */
 
-
-static int parse_user_sigframe(struct user_ctxs *user,
-			       struct rt_sigframe __user *sf)
+static int __parse_user_sigcontext(struct user_ctxs *user,
+				   struct sigcontext __user const *sc,
+				   void __user const *sigframe_base)
 {
-	struct sigcontext __user *const sc = &sf->uc.uc_mcontext;
 	struct _aarch64_ctx __user *head;
 	char __user *base = (char __user *)&sc->__reserved;
 	size_t offset = 0;
 	size_t limit = sizeof(sc->__reserved);
 	bool have_extra_context = false;
-	char const __user *const sfp = (char const __user *)sf;
+	char const __user *const sfp = (char const __user *)sigframe_base;
 
 	user->fpsimd = NULL;
 	user->sve = NULL;
@@ -493,6 +492,9 @@ static int parse_user_sigframe(struct user_ctxs *user,
 	return -EINVAL;
 }
 
+#define parse_user_sigcontext(user, sf)					\
+	__parse_user_sigcontext(user, &(sf)->uc.uc_mcontext, sf)
+
 static int restore_sigframe(struct pt_regs *regs,
 			    struct rt_sigframe __user *sf)
 {
@@ -518,7 +520,7 @@ static int restore_sigframe(struct pt_regs *regs,
 
 	err |= !valid_user_regs(&regs->user_regs, current);
 	if (err == 0)
-		err = parse_user_sigframe(&user, sf);
+		err = parse_user_sigcontext(&user, sf);
 
 	if (err == 0) {
 		if (!user.fpsimd)
-- 
2.17.0

^ permalink raw reply related	[flat|nested] 104+ messages in thread

* [PATCH 01/24] arm64: signal: Make parse_user_sigframe() independent of rt_sigframe layout
@ 2018-05-15 19:11   ` Yury Norov
  0 siblings, 0 replies; 104+ messages in thread
From: Yury Norov @ 2018-05-15 19:11 UTC (permalink / raw)
  To: linux-arm-kernel

From: Dave Martin <Dave.Martin@arm.com>

ILP32 uses the same struct sigcontext as the native ABI (i.e.,
LP64), but a different layout for the rest of the signal frame (since
siginfo_t and ucontext_t are both ABI-dependent).

Since the purpose of parse_user_sigframe() is really to parse sigcontext
and not the whole signal frame, the function does not need to depend
on the layout of rt_sigframe -- the only purpose of the rt_sigframe
pointer is for use as a base to measure the signal frame size.

So, this patch renames the function to make it clear that only the
sigcontext is really being parsed, and makes the sigframe base pointer
generic.  A macro is defined to provide a suitable duck-typed interface
that can be used with both sigframe definitions.

Suggested-by: Yury Norov <ynorov@caviumnetworks.com>
Signed-off-by: Dave Martin <Dave.Martin@arm.com>
Signed-off-by: Yury Norov <ynorov@caviumnetworks.com>
---
 arch/arm64/kernel/signal.c | 14 ++++++++------
 1 file changed, 8 insertions(+), 6 deletions(-)

diff --git a/arch/arm64/kernel/signal.c b/arch/arm64/kernel/signal.c
index f60c052e8d1c..65406218743c 100644
--- a/arch/arm64/kernel/signal.c
+++ b/arch/arm64/kernel/signal.c
@@ -334,17 +334,16 @@ extern int restore_sve_fpsimd_context(struct user_ctxs *user);
 
 #endif /* ! CONFIG_ARM64_SVE */
 
-
-static int parse_user_sigframe(struct user_ctxs *user,
-			       struct rt_sigframe __user *sf)
+static int __parse_user_sigcontext(struct user_ctxs *user,
+				   struct sigcontext __user const *sc,
+				   void __user const *sigframe_base)
 {
-	struct sigcontext __user *const sc = &sf->uc.uc_mcontext;
 	struct _aarch64_ctx __user *head;
 	char __user *base = (char __user *)&sc->__reserved;
 	size_t offset = 0;
 	size_t limit = sizeof(sc->__reserved);
 	bool have_extra_context = false;
-	char const __user *const sfp = (char const __user *)sf;
+	char const __user *const sfp = (char const __user *)sigframe_base;
 
 	user->fpsimd = NULL;
 	user->sve = NULL;
@@ -493,6 +492,9 @@ static int parse_user_sigframe(struct user_ctxs *user,
 	return -EINVAL;
 }
 
+#define parse_user_sigcontext(user, sf)					\
+	__parse_user_sigcontext(user, &(sf)->uc.uc_mcontext, sf)
+
 static int restore_sigframe(struct pt_regs *regs,
 			    struct rt_sigframe __user *sf)
 {
@@ -518,7 +520,7 @@ static int restore_sigframe(struct pt_regs *regs,
 
 	err |= !valid_user_regs(&regs->user_regs, current);
 	if (err == 0)
-		err = parse_user_sigframe(&user, sf);
+		err = parse_user_sigcontext(&user, sf);
 
 	if (err == 0) {
 		if (!user.fpsimd)
-- 
2.17.0

^ permalink raw reply related	[flat|nested] 104+ messages in thread

* [PATCH 02/24] ptrace: Add compat PTRACE_{G,S}ETSIGMASK handlers
  2018-05-15 19:11 ` Yury Norov
  (?)
  (?)
@ 2018-05-15 19:11   ` Yury Norov
  -1 siblings, 0 replies; 104+ messages in thread
From: Yury Norov @ 2018-05-15 19:11 UTC (permalink / raw)
  To: Catalin Marinas, Arnd Bergmann, linux-arm-kernel, linux-kernel,
	linux-doc, linux-arch, linux-api
  Cc: Yury Norov, Adam Borowski, Alexander Graf, Alexey Klimov,
	Andreas Schwab, Andrew Pinski, Bamvor Zhangjian, Chris Metcalf,
	Christoph Muellner, Dave Martin, David S . Miller,
	Florian Weimer, Geert Uytterhoeven, Heiko Carstens, James Hogan,
	James Morse, Joseph Myers, Lin Yongting, Manuel Montezelo,
	Mark Brown, Martin Schwidefsky, Maxim Kuvyrkov, Nathan_Lynch,
	Philipp Tomsich, Prasun Kapoor, Ramana Radhakrishnan,
	Steve Ellcey, Szabolcs Nagy, Zhou Chengming, Andrey Vagin

From: James Morse <james.morse@arm.com>

compat_ptrace_request() lacks handlers for PTRACE_{G,S}ETSIGMASK,
instead using those in ptrace_request(). The compat variant should
read a compat_sigset_t from userspace instead of ptrace_request()s
sigset_t.

While compat_sigset_t is the same size as sigset_t, it is defined as
2xu32, instead of a single u64. On a big-endian CPU this means that
compat_sigset_t is passed to user-space using middle-endianness,
where the least-significant u32 is written most significant byte
first.

If ptrace_request()s code is used userspace will read the most
significant u32 where it expected the least significant.

Instead of duplicating ptrace_request()s code as a special case in
the arch code, handle it here.

Fixes: 29000caecbe87 ("ptrace: add ability to get/set signal-blocked mask")
CC: Andrey Vagin <avagin@openvz.org>
Reported-by: Zhou Chengming <zhouchengming1@huawei.com>
Signed-off-by: James Morse <james.morse@arm.com>

Yury:
Replace sigset_{to,from}_compat() with new {get,put}_compat_sigset()
Signed-off-by: Yury Norov <ynorov@caviumnetworks.com>
---
 kernel/ptrace.c | 48 ++++++++++++++++++++++++++++++++++++------------
 1 file changed, 36 insertions(+), 12 deletions(-)

diff --git a/kernel/ptrace.c b/kernel/ptrace.c
index 21fec73d45d4..214944d7c268 100644
--- a/kernel/ptrace.c
+++ b/kernel/ptrace.c
@@ -880,6 +880,22 @@ static int ptrace_regset(struct task_struct *task, int req, unsigned int type,
 EXPORT_SYMBOL_GPL(task_user_regset_view);
 #endif
 
+static int ptrace_setsigmask(struct task_struct *child, sigset_t *new_set)
+{
+	sigdelsetmask(new_set, sigmask(SIGKILL)|sigmask(SIGSTOP));
+
+	/*
+	 * Every thread does recalc_sigpending() after resume, so
+	 * retarget_shared_pending() and recalc_sigpending() are not
+	 * called here.
+	 */
+	spin_lock_irq(&child->sighand->siglock);
+	child->blocked = *new_set;
+	spin_unlock_irq(&child->sighand->siglock);
+
+	return 0;
+}
+
 int ptrace_request(struct task_struct *child, long request,
 		   unsigned long addr, unsigned long data)
 {
@@ -951,18 +967,7 @@ int ptrace_request(struct task_struct *child, long request,
 			break;
 		}
 
-		sigdelsetmask(&new_set, sigmask(SIGKILL)|sigmask(SIGSTOP));
-
-		/*
-		 * Every thread does recalc_sigpending() after resume, so
-		 * retarget_shared_pending() and recalc_sigpending() are not
-		 * called here.
-		 */
-		spin_lock_irq(&child->sighand->siglock);
-		child->blocked = new_set;
-		spin_unlock_irq(&child->sighand->siglock);
-
-		ret = 0;
+		ret = ptrace_setsigmask(child, &new_set);
 		break;
 	}
 
@@ -1181,6 +1186,7 @@ int compat_ptrace_request(struct task_struct *child, compat_long_t request,
 {
 	compat_ulong_t __user *datap = compat_ptr(data);
 	compat_ulong_t word;
+	sigset_t new_set;
 	siginfo_t siginfo;
 	int ret;
 
@@ -1221,6 +1227,24 @@ int compat_ptrace_request(struct task_struct *child, compat_long_t request,
 		else
 			ret = ptrace_setsiginfo(child, &siginfo);
 		break;
+	case PTRACE_GETSIGMASK:
+		if (addr != sizeof(compat_sigset_t))
+			return -EINVAL;
+
+		ret = put_compat_sigset((compat_sigset_t __user *) datap,
+				&child->blocked, sizeof(compat_sigset_t));
+		break;
+	case PTRACE_SETSIGMASK:
+		if (addr != sizeof(compat_sigset_t))
+			return -EINVAL;
+
+		ret = get_compat_sigset(&new_set,
+				(compat_sigset_t __user *) datap);
+		if (ret)
+			break;
+
+		ret = ptrace_setsigmask(child, &new_set);
+		break;
 #ifdef CONFIG_HAVE_ARCH_TRACEHOOK
 	case PTRACE_GETREGSET:
 	case PTRACE_SETREGSET:
-- 
2.17.0


^ permalink raw reply related	[flat|nested] 104+ messages in thread

* [PATCH 02/24] ptrace: Add compat PTRACE_{G,S}ETSIGMASK handlers
@ 2018-05-15 19:11   ` Yury Norov
  0 siblings, 0 replies; 104+ messages in thread
From: Yury Norov @ 2018-05-15 19:11 UTC (permalink / raw)
  To: Catalin Marinas, Arnd Bergmann, linux-arm-kernel, linux-kernel,
	linux-doc, linux-arch, linux-api
  Cc: Yury Norov, Adam Borowski, Alexander Graf, Alexey Klimov,
	Andreas Schwab, Andrew Pinski, Bamvor Zhangjian, Chris Metcalf,
	Christoph Muellner, Dave Martin, David S . Miller,
	Florian Weimer, Geert Uytterhoeven, Heiko Carstens, James Hogan,
	James Morse, Joseph Myers, Lin Yongting, Manuel Montezelo,
	Mark Brown, Martin Schwidefsky, Maxim Kuvyrkov, Nathan_Lynch,
	Philipp Tomsich, Prasun Kapoor, Ramana Radhakrishnan,
	Steve Ellcey, Szabolcs Nagy, Zhou Chengming, Andrey Vagin

From: James Morse <james.morse@arm.com>

compat_ptrace_request() lacks handlers for PTRACE_{G,S}ETSIGMASK,
instead using those in ptrace_request(). The compat variant should
read a compat_sigset_t from userspace instead of ptrace_request()s
sigset_t.

While compat_sigset_t is the same size as sigset_t, it is defined as
2xu32, instead of a single u64. On a big-endian CPU this means that
compat_sigset_t is passed to user-space using middle-endianness,
where the least-significant u32 is written most significant byte
first.

If ptrace_request()s code is used userspace will read the most
significant u32 where it expected the least significant.

Instead of duplicating ptrace_request()s code as a special case in
the arch code, handle it here.

Fixes: 29000caecbe87 ("ptrace: add ability to get/set signal-blocked mask")
CC: Andrey Vagin <avagin@openvz.org>
Reported-by: Zhou Chengming <zhouchengming1@huawei.com>
Signed-off-by: James Morse <james.morse@arm.com>

Yury:
Replace sigset_{to,from}_compat() with new {get,put}_compat_sigset()
Signed-off-by: Yury Norov <ynorov@caviumnetworks.com>
---
 kernel/ptrace.c | 48 ++++++++++++++++++++++++++++++++++++------------
 1 file changed, 36 insertions(+), 12 deletions(-)

diff --git a/kernel/ptrace.c b/kernel/ptrace.c
index 21fec73d45d4..214944d7c268 100644
--- a/kernel/ptrace.c
+++ b/kernel/ptrace.c
@@ -880,6 +880,22 @@ static int ptrace_regset(struct task_struct *task, int req, unsigned int type,
 EXPORT_SYMBOL_GPL(task_user_regset_view);
 #endif
 
+static int ptrace_setsigmask(struct task_struct *child, sigset_t *new_set)
+{
+	sigdelsetmask(new_set, sigmask(SIGKILL)|sigmask(SIGSTOP));
+
+	/*
+	 * Every thread does recalc_sigpending() after resume, so
+	 * retarget_shared_pending() and recalc_sigpending() are not
+	 * called here.
+	 */
+	spin_lock_irq(&child->sighand->siglock);
+	child->blocked = *new_set;
+	spin_unlock_irq(&child->sighand->siglock);
+
+	return 0;
+}
+
 int ptrace_request(struct task_struct *child, long request,
 		   unsigned long addr, unsigned long data)
 {
@@ -951,18 +967,7 @@ int ptrace_request(struct task_struct *child, long request,
 			break;
 		}
 
-		sigdelsetmask(&new_set, sigmask(SIGKILL)|sigmask(SIGSTOP));
-
-		/*
-		 * Every thread does recalc_sigpending() after resume, so
-		 * retarget_shared_pending() and recalc_sigpending() are not
-		 * called here.
-		 */
-		spin_lock_irq(&child->sighand->siglock);
-		child->blocked = new_set;
-		spin_unlock_irq(&child->sighand->siglock);
-
-		ret = 0;
+		ret = ptrace_setsigmask(child, &new_set);
 		break;
 	}
 
@@ -1181,6 +1186,7 @@ int compat_ptrace_request(struct task_struct *child, compat_long_t request,
 {
 	compat_ulong_t __user *datap = compat_ptr(data);
 	compat_ulong_t word;
+	sigset_t new_set;
 	siginfo_t siginfo;
 	int ret;
 
@@ -1221,6 +1227,24 @@ int compat_ptrace_request(struct task_struct *child, compat_long_t request,
 		else
 			ret = ptrace_setsiginfo(child, &siginfo);
 		break;
+	case PTRACE_GETSIGMASK:
+		if (addr != sizeof(compat_sigset_t))
+			return -EINVAL;
+
+		ret = put_compat_sigset((compat_sigset_t __user *) datap,
+				&child->blocked, sizeof(compat_sigset_t));
+		break;
+	case PTRACE_SETSIGMASK:
+		if (addr != sizeof(compat_sigset_t))
+			return -EINVAL;
+
+		ret = get_compat_sigset(&new_set,
+				(compat_sigset_t __user *) datap);
+		if (ret)
+			break;
+
+		ret = ptrace_setsigmask(child, &new_set);
+		break;
 #ifdef CONFIG_HAVE_ARCH_TRACEHOOK
 	case PTRACE_GETREGSET:
 	case PTRACE_SETREGSET:
-- 
2.17.0

--
To unsubscribe from this list: send the line "unsubscribe linux-doc" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply related	[flat|nested] 104+ messages in thread

* [PATCH 02/24] ptrace: Add compat PTRACE_{G,S}ETSIGMASK handlers
@ 2018-05-15 19:11   ` Yury Norov
  0 siblings, 0 replies; 104+ messages in thread
From: Yury Norov @ 2018-05-15 19:11 UTC (permalink / raw)
  To: Catalin Marinas, Arnd Bergmann, linux-arm-kernel, linux-kernel,
	linux-doc, linux-arch, linux-api
  Cc: Yury Norov, Adam Borowski, Alexander Graf, Alexey Klimov,
	Andreas Schwab, Andrew Pinski, Bamvor Zhangjian, Chris Metcalf,
	Christoph Muellner, Dave Martin, David S . Miller,
	Florian Weimer, Geert Uytterhoeven, Heiko Carstens, James Hogan,
	James Morse, Joseph Myers, Lin Yongting, Manuel Montezelo

From: James Morse <james.morse@arm.com>

compat_ptrace_request() lacks handlers for PTRACE_{G,S}ETSIGMASK,
instead using those in ptrace_request(). The compat variant should
read a compat_sigset_t from userspace instead of ptrace_request()s
sigset_t.

While compat_sigset_t is the same size as sigset_t, it is defined as
2xu32, instead of a single u64. On a big-endian CPU this means that
compat_sigset_t is passed to user-space using middle-endianness,
where the least-significant u32 is written most significant byte
first.

If ptrace_request()s code is used userspace will read the most
significant u32 where it expected the least significant.

Instead of duplicating ptrace_request()s code as a special case in
the arch code, handle it here.

Fixes: 29000caecbe87 ("ptrace: add ability to get/set signal-blocked mask")
CC: Andrey Vagin <avagin@openvz.org>
Reported-by: Zhou Chengming <zhouchengming1@huawei.com>
Signed-off-by: James Morse <james.morse@arm.com>

Yury:
Replace sigset_{to,from}_compat() with new {get,put}_compat_sigset()
Signed-off-by: Yury Norov <ynorov@caviumnetworks.com>
---
 kernel/ptrace.c | 48 ++++++++++++++++++++++++++++++++++++------------
 1 file changed, 36 insertions(+), 12 deletions(-)

diff --git a/kernel/ptrace.c b/kernel/ptrace.c
index 21fec73d45d4..214944d7c268 100644
--- a/kernel/ptrace.c
+++ b/kernel/ptrace.c
@@ -880,6 +880,22 @@ static int ptrace_regset(struct task_struct *task, int req, unsigned int type,
 EXPORT_SYMBOL_GPL(task_user_regset_view);
 #endif
 
+static int ptrace_setsigmask(struct task_struct *child, sigset_t *new_set)
+{
+	sigdelsetmask(new_set, sigmask(SIGKILL)|sigmask(SIGSTOP));
+
+	/*
+	 * Every thread does recalc_sigpending() after resume, so
+	 * retarget_shared_pending() and recalc_sigpending() are not
+	 * called here.
+	 */
+	spin_lock_irq(&child->sighand->siglock);
+	child->blocked = *new_set;
+	spin_unlock_irq(&child->sighand->siglock);
+
+	return 0;
+}
+
 int ptrace_request(struct task_struct *child, long request,
 		   unsigned long addr, unsigned long data)
 {
@@ -951,18 +967,7 @@ int ptrace_request(struct task_struct *child, long request,
 			break;
 		}
 
-		sigdelsetmask(&new_set, sigmask(SIGKILL)|sigmask(SIGSTOP));
-
-		/*
-		 * Every thread does recalc_sigpending() after resume, so
-		 * retarget_shared_pending() and recalc_sigpending() are not
-		 * called here.
-		 */
-		spin_lock_irq(&child->sighand->siglock);
-		child->blocked = new_set;
-		spin_unlock_irq(&child->sighand->siglock);
-
-		ret = 0;
+		ret = ptrace_setsigmask(child, &new_set);
 		break;
 	}
 
@@ -1181,6 +1186,7 @@ int compat_ptrace_request(struct task_struct *child, compat_long_t request,
 {
 	compat_ulong_t __user *datap = compat_ptr(data);
 	compat_ulong_t word;
+	sigset_t new_set;
 	siginfo_t siginfo;
 	int ret;
 
@@ -1221,6 +1227,24 @@ int compat_ptrace_request(struct task_struct *child, compat_long_t request,
 		else
 			ret = ptrace_setsiginfo(child, &siginfo);
 		break;
+	case PTRACE_GETSIGMASK:
+		if (addr != sizeof(compat_sigset_t))
+			return -EINVAL;
+
+		ret = put_compat_sigset((compat_sigset_t __user *) datap,
+				&child->blocked, sizeof(compat_sigset_t));
+		break;
+	case PTRACE_SETSIGMASK:
+		if (addr != sizeof(compat_sigset_t))
+			return -EINVAL;
+
+		ret = get_compat_sigset(&new_set,
+				(compat_sigset_t __user *) datap);
+		if (ret)
+			break;
+
+		ret = ptrace_setsigmask(child, &new_set);
+		break;
 #ifdef CONFIG_HAVE_ARCH_TRACEHOOK
 	case PTRACE_GETREGSET:
 	case PTRACE_SETREGSET:
-- 
2.17.0

^ permalink raw reply related	[flat|nested] 104+ messages in thread

* [PATCH 02/24] ptrace: Add compat PTRACE_{G,S}ETSIGMASK handlers
@ 2018-05-15 19:11   ` Yury Norov
  0 siblings, 0 replies; 104+ messages in thread
From: Yury Norov @ 2018-05-15 19:11 UTC (permalink / raw)
  To: linux-arm-kernel

From: James Morse <james.morse@arm.com>

compat_ptrace_request() lacks handlers for PTRACE_{G,S}ETSIGMASK,
instead using those in ptrace_request(). The compat variant should
read a compat_sigset_t from userspace instead of ptrace_request()s
sigset_t.

While compat_sigset_t is the same size as sigset_t, it is defined as
2xu32, instead of a single u64. On a big-endian CPU this means that
compat_sigset_t is passed to user-space using middle-endianness,
where the least-significant u32 is written most significant byte
first.

If ptrace_request()s code is used userspace will read the most
significant u32 where it expected the least significant.

Instead of duplicating ptrace_request()s code as a special case in
the arch code, handle it here.

Fixes: 29000caecbe87 ("ptrace: add ability to get/set signal-blocked mask")
CC: Andrey Vagin <avagin@openvz.org>
Reported-by: Zhou Chengming <zhouchengming1@huawei.com>
Signed-off-by: James Morse <james.morse@arm.com>

Yury:
Replace sigset_{to,from}_compat() with new {get,put}_compat_sigset()
Signed-off-by: Yury Norov <ynorov@caviumnetworks.com>
---
 kernel/ptrace.c | 48 ++++++++++++++++++++++++++++++++++++------------
 1 file changed, 36 insertions(+), 12 deletions(-)

diff --git a/kernel/ptrace.c b/kernel/ptrace.c
index 21fec73d45d4..214944d7c268 100644
--- a/kernel/ptrace.c
+++ b/kernel/ptrace.c
@@ -880,6 +880,22 @@ static int ptrace_regset(struct task_struct *task, int req, unsigned int type,
 EXPORT_SYMBOL_GPL(task_user_regset_view);
 #endif
 
+static int ptrace_setsigmask(struct task_struct *child, sigset_t *new_set)
+{
+	sigdelsetmask(new_set, sigmask(SIGKILL)|sigmask(SIGSTOP));
+
+	/*
+	 * Every thread does recalc_sigpending() after resume, so
+	 * retarget_shared_pending() and recalc_sigpending() are not
+	 * called here.
+	 */
+	spin_lock_irq(&child->sighand->siglock);
+	child->blocked = *new_set;
+	spin_unlock_irq(&child->sighand->siglock);
+
+	return 0;
+}
+
 int ptrace_request(struct task_struct *child, long request,
 		   unsigned long addr, unsigned long data)
 {
@@ -951,18 +967,7 @@ int ptrace_request(struct task_struct *child, long request,
 			break;
 		}
 
-		sigdelsetmask(&new_set, sigmask(SIGKILL)|sigmask(SIGSTOP));
-
-		/*
-		 * Every thread does recalc_sigpending() after resume, so
-		 * retarget_shared_pending() and recalc_sigpending() are not
-		 * called here.
-		 */
-		spin_lock_irq(&child->sighand->siglock);
-		child->blocked = new_set;
-		spin_unlock_irq(&child->sighand->siglock);
-
-		ret = 0;
+		ret = ptrace_setsigmask(child, &new_set);
 		break;
 	}
 
@@ -1181,6 +1186,7 @@ int compat_ptrace_request(struct task_struct *child, compat_long_t request,
 {
 	compat_ulong_t __user *datap = compat_ptr(data);
 	compat_ulong_t word;
+	sigset_t new_set;
 	siginfo_t siginfo;
 	int ret;
 
@@ -1221,6 +1227,24 @@ int compat_ptrace_request(struct task_struct *child, compat_long_t request,
 		else
 			ret = ptrace_setsiginfo(child, &siginfo);
 		break;
+	case PTRACE_GETSIGMASK:
+		if (addr != sizeof(compat_sigset_t))
+			return -EINVAL;
+
+		ret = put_compat_sigset((compat_sigset_t __user *) datap,
+				&child->blocked, sizeof(compat_sigset_t));
+		break;
+	case PTRACE_SETSIGMASK:
+		if (addr != sizeof(compat_sigset_t))
+			return -EINVAL;
+
+		ret = get_compat_sigset(&new_set,
+				(compat_sigset_t __user *) datap);
+		if (ret)
+			break;
+
+		ret = ptrace_setsigmask(child, &new_set);
+		break;
 #ifdef CONFIG_HAVE_ARCH_TRACEHOOK
 	case PTRACE_GETREGSET:
 	case PTRACE_SETREGSET:
-- 
2.17.0

^ permalink raw reply related	[flat|nested] 104+ messages in thread

* Re: [PATCH v9 00/24] ILP32 for ARM64
  2018-05-15 19:11 ` Yury Norov
  (?)
  (?)
@ 2018-05-15 19:40   ` Yury Norov
  -1 siblings, 0 replies; 104+ messages in thread
From: Yury Norov @ 2018-05-15 19:40 UTC (permalink / raw)
  To: Catalin Marinas, Arnd Bergmann, linux-arm-kernel, linux-kernel,
	linux-doc, linux-arch, linux-api
  Cc: Adam Borowski, Alexander Graf, Alexey Klimov, Andreas Schwab,
	Andrew Pinski, Bamvor Zhangjian, Chris Metcalf,
	Christoph Muellner, Dave Martin, David S . Miller,
	Florian Weimer, Geert Uytterhoeven, Heiko Carstens, James Hogan,
	James Morse, Joseph Myers, Lin Yongting, Manuel Montezelo,
	Mark Brown, Martin Schwidefsky, Maxim Kuvyrkov, Nathan_Lynch,
	Philipp Tomsich, Prasun Kapoor, Ramana Radhakrishnan,
	Steve Ellcey, Szabolcs Nagy, Zhou Chengming

Hi all,

On Tue, May 15, 2018 at 10:11:50PM +0300, Yury Norov wrote:
> This series enables AARCH64 with ILP32 mode.
> 
> As supporting work, it introduces ARCH_32BIT_OFF_T configuration
> option that is enabled for existing 32-bit architectures but disabled
> for new arches (so 64-bit off_t userspace type is used by new userspace).
> Also it deprecates getrlimit and setrlimit syscalls prior to prlimit64.
> 
> Based on kernel v4.16. Tested with LTP, glibc testsuite, trinity, lmbench,
> CPUSpec.
> 
> This series on github: 
> https://github.com/norov/linux/tree/ilp32-4.16
> Linaro toolchain:
> http://snapshots.linaro.org/components/toolchain/binaries/7.3-2018.04-rc1/aarch64-linux-gnu_ilp32/
> Debian repo:
> http://people.linaro.org/~wookey/ilp32/
> OpenSUSE repo:
> https://build.opensuse.org/project/show/devel:ARM:Factory:Contrib:ILP32
> 
> Changes:
> v3: https://lkml.org/lkml/2014/9/3/704
> v4: https://lkml.org/lkml/2015/4/13/691
> v5: https://lkml.org/lkml/2015/9/29/911
> v6: https://lkml.org/lkml/2016/5/23/661
> v7: https://lkml.org/lkml/2017/1/9/213
> v8: https://lkml.org/lkml/2017/6/19/624
> v9: - rebased on top of v4.16;
>     - signal subsystem reworked to avoid code duplication, as requested
>       by Dave Martin (patches 18 and 20);
>     - new files introduced in series use SPDX notation for license;
>     - linux-api and linux-arch CCed as the series changes kernel ABI;
>     - checkpatch and other minor fixes.

My mail server seems broken. I will try to submit series tomorroe
again. Sorry for noise.

Yury

^ permalink raw reply	[flat|nested] 104+ messages in thread

* Re: [PATCH v9 00/24] ILP32 for ARM64
@ 2018-05-15 19:40   ` Yury Norov
  0 siblings, 0 replies; 104+ messages in thread
From: Yury Norov @ 2018-05-15 19:40 UTC (permalink / raw)
  To: Catalin Marinas, Arnd Bergmann, linux-arm-kernel, linux-kernel,
	linux-doc, linux-arch, linux-api
  Cc: Adam Borowski, Alexander Graf, Alexey Klimov, Andreas Schwab,
	Andrew Pinski, Bamvor Zhangjian, Chris Metcalf,
	Christoph Muellner, Dave Martin, David S . Miller,
	Florian Weimer, Geert Uytterhoeven, Heiko Carstens, James Hogan,
	James Morse, Joseph Myers, Lin Yongting, Manuel Montezelo,
	Mark Brown, Martin Schwidefsky, Maxim Kuvyrkov, Nathan_Lynch,
	Philipp Tomsich, Prasun Kapoor, Ramana Radhakrishnan,
	Steve Ellcey, Szabolcs Nagy, Zhou Chengming

Hi all,

On Tue, May 15, 2018 at 10:11:50PM +0300, Yury Norov wrote:
> This series enables AARCH64 with ILP32 mode.
> 
> As supporting work, it introduces ARCH_32BIT_OFF_T configuration
> option that is enabled for existing 32-bit architectures but disabled
> for new arches (so 64-bit off_t userspace type is used by new userspace).
> Also it deprecates getrlimit and setrlimit syscalls prior to prlimit64.
> 
> Based on kernel v4.16. Tested with LTP, glibc testsuite, trinity, lmbench,
> CPUSpec.
> 
> This series on github: 
> https://github.com/norov/linux/tree/ilp32-4.16
> Linaro toolchain:
> http://snapshots.linaro.org/components/toolchain/binaries/7.3-2018.04-rc1/aarch64-linux-gnu_ilp32/
> Debian repo:
> http://people.linaro.org/~wookey/ilp32/
> OpenSUSE repo:
> https://build.opensuse.org/project/show/devel:ARM:Factory:Contrib:ILP32
> 
> Changes:
> v3: https://lkml.org/lkml/2014/9/3/704
> v4: https://lkml.org/lkml/2015/4/13/691
> v5: https://lkml.org/lkml/2015/9/29/911
> v6: https://lkml.org/lkml/2016/5/23/661
> v7: https://lkml.org/lkml/2017/1/9/213
> v8: https://lkml.org/lkml/2017/6/19/624
> v9: - rebased on top of v4.16;
>     - signal subsystem reworked to avoid code duplication, as requested
>       by Dave Martin (patches 18 and 20);
>     - new files introduced in series use SPDX notation for license;
>     - linux-api and linux-arch CCed as the series changes kernel ABI;
>     - checkpatch and other minor fixes.

My mail server seems broken. I will try to submit series tomorroe
again. Sorry for noise.

Yury
--
To unsubscribe from this list: send the line "unsubscribe linux-doc" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 104+ messages in thread

* Re: [PATCH v9 00/24] ILP32 for ARM64
@ 2018-05-15 19:40   ` Yury Norov
  0 siblings, 0 replies; 104+ messages in thread
From: Yury Norov @ 2018-05-15 19:40 UTC (permalink / raw)
  To: Catalin Marinas, Arnd Bergmann, linux-arm-kernel, linux-kernel,
	linux-doc, linux-arch, linux-api
  Cc: Adam Borowski, Alexander Graf, Alexey Klimov, Andreas Schwab,
	Andrew Pinski, Bamvor Zhangjian, Chris Metcalf,
	Christoph Muellner, Dave Martin, David S . Miller,
	Florian Weimer, Geert Uytterhoeven, Heiko Carstens, James Hogan,
	James Morse, Joseph Myers, Lin Yongting, Manuel Montezelo,
	Mark Brown

Hi all,

On Tue, May 15, 2018 at 10:11:50PM +0300, Yury Norov wrote:
> This series enables AARCH64 with ILP32 mode.
> 
> As supporting work, it introduces ARCH_32BIT_OFF_T configuration
> option that is enabled for existing 32-bit architectures but disabled
> for new arches (so 64-bit off_t userspace type is used by new userspace).
> Also it deprecates getrlimit and setrlimit syscalls prior to prlimit64.
> 
> Based on kernel v4.16. Tested with LTP, glibc testsuite, trinity, lmbench,
> CPUSpec.
> 
> This series on github: 
> https://github.com/norov/linux/tree/ilp32-4.16
> Linaro toolchain:
> http://snapshots.linaro.org/components/toolchain/binaries/7.3-2018.04-rc1/aarch64-linux-gnu_ilp32/
> Debian repo:
> http://people.linaro.org/~wookey/ilp32/
> OpenSUSE repo:
> https://build.opensuse.org/project/show/devel:ARM:Factory:Contrib:ILP32
> 
> Changes:
> v3: https://lkml.org/lkml/2014/9/3/704
> v4: https://lkml.org/lkml/2015/4/13/691
> v5: https://lkml.org/lkml/2015/9/29/911
> v6: https://lkml.org/lkml/2016/5/23/661
> v7: https://lkml.org/lkml/2017/1/9/213
> v8: https://lkml.org/lkml/2017/6/19/624
> v9: - rebased on top of v4.16;
>     - signal subsystem reworked to avoid code duplication, as requested
>       by Dave Martin (patches 18 and 20);
>     - new files introduced in series use SPDX notation for license;
>     - linux-api and linux-arch CCed as the series changes kernel ABI;
>     - checkpatch and other minor fixes.

My mail server seems broken. I will try to submit series tomorroe
again. Sorry for noise.

Yury

^ permalink raw reply	[flat|nested] 104+ messages in thread

* [PATCH v9 00/24] ILP32 for ARM64
@ 2018-05-15 19:40   ` Yury Norov
  0 siblings, 0 replies; 104+ messages in thread
From: Yury Norov @ 2018-05-15 19:40 UTC (permalink / raw)
  To: linux-arm-kernel

Hi all,

On Tue, May 15, 2018 at 10:11:50PM +0300, Yury Norov wrote:
> This series enables AARCH64 with ILP32 mode.
> 
> As supporting work, it introduces ARCH_32BIT_OFF_T configuration
> option that is enabled for existing 32-bit architectures but disabled
> for new arches (so 64-bit off_t userspace type is used by new userspace).
> Also it deprecates getrlimit and setrlimit syscalls prior to prlimit64.
> 
> Based on kernel v4.16. Tested with LTP, glibc testsuite, trinity, lmbench,
> CPUSpec.
> 
> This series on github: 
> https://github.com/norov/linux/tree/ilp32-4.16
> Linaro toolchain:
> http://snapshots.linaro.org/components/toolchain/binaries/7.3-2018.04-rc1/aarch64-linux-gnu_ilp32/
> Debian repo:
> http://people.linaro.org/~wookey/ilp32/
> OpenSUSE repo:
> https://build.opensuse.org/project/show/devel:ARM:Factory:Contrib:ILP32
> 
> Changes:
> v3: https://lkml.org/lkml/2014/9/3/704
> v4: https://lkml.org/lkml/2015/4/13/691
> v5: https://lkml.org/lkml/2015/9/29/911
> v6: https://lkml.org/lkml/2016/5/23/661
> v7: https://lkml.org/lkml/2017/1/9/213
> v8: https://lkml.org/lkml/2017/6/19/624
> v9: - rebased on top of v4.16;
>     - signal subsystem reworked to avoid code duplication, as requested
>       by Dave Martin (patches 18 and 20);
>     - new files introduced in series use SPDX notation for license;
>     - linux-api and linux-arch CCed as the series changes kernel ABI;
>     - checkpatch and other minor fixes.

My mail server seems broken. I will try to submit series tomorroe
again. Sorry for noise.

Yury

^ permalink raw reply	[flat|nested] 104+ messages in thread

* Re: [PATCH v9 00/24] ILP32 for ARM64
  2018-05-16  8:18 ` Yury Norov
  (?)
@ 2019-07-09 22:42   ` Yury Norov
  -1 siblings, 0 replies; 104+ messages in thread
From: Yury Norov @ 2019-07-09 22:42 UTC (permalink / raw)
  To: Yury Norov
  Cc: Catalin Marinas, Arnd Bergmann, linux-arm-kernel, linux-kernel,
	linux-doc, linux-arch, linux-api, Adam Borowski, Alexander Graf,
	Alexey Klimov, Andreas Schwab, Andrew Pinski, Bamvor Zhangjian,
	Chris Metcalf, Christoph Muellner, Dave Martin, David S . Miller,
	Florian Weimer, Geert Uytterhoeven, Heiko Carstens, James Hogan,
	James Morse, Joseph Myers, Lin Yongting, Manuel Montezelo,
	Mark Brown, Martin Schwidefsky, Maxim Kuvyrkov, Nathan_Lynch,
	Philipp Tomsich, Prasun Kapoor, Ramana Radhakrishnan,
	Steve Ellcey, Szabolcs Nagy

Hi all,

On Wed, May 16, 2018 at 11:18:45AM +0300, Yury Norov wrote:
> This series enables AARCH64 with ILP32 mode.
> 
> As supporting work, it introduces ARCH_32BIT_OFF_T configuration
> option that is enabled for existing 32-bit architectures but disabled
> for new arches (so 64-bit off_t userspace type is used by new userspace).
> Also it deprecates getrlimit and setrlimit syscalls prior to prlimit64.
> 
> Based on kernel v4.16. Tested with LTP, glibc testsuite, trinity, lmbench,
> CPUSpec.
> 
> This series on github: 
> https://github.com/norov/linux/tree/ilp32-4.16
> Linaro toolchain:
> http://snapshots.linaro.org/components/toolchain/binaries/7.3-2018.04-rc1/aarch64-linux-gnu_ilp32/
> Debian repo:
> http://people.linaro.org/~wookey/ilp32/
> OpenSUSE repo:
> https://build.opensuse.org/project/show/devel:ARM:Factory:Contrib:ILP32
> 
> Changes:
> v3: https://lkml.org/lkml/2014/9/3/704
> v4: https://lkml.org/lkml/2015/4/13/691
> v5: https://lkml.org/lkml/2015/9/29/911
> v6: https://lkml.org/lkml/2016/5/23/661
> v7: https://lkml.org/lkml/2017/1/9/213
> v8: https://lkml.org/lkml/2017/6/19/624
> v9: - rebased on top of v4.16;
>     - signal subsystem reworked to avoid code duplication, as requested
>       by Dave Martin (patches 18 and 20);
>     - new files introduced in series use SPDX notation for license;
>     - linux-api and linux-arch CCed as the series changes kernel ABI;
>     - checkpatch and other minor fixes.
>     - Zhou Chengming's reported-by for patch 2 and signed-off-by for
>       patch 21 removed because his email became invalid. Zhou, please
>       share your new email.

This is a 5.2-based version of series.
https://github.com/norov/linux/tree/ilp32-5.2

Thanks,
Yury

^ permalink raw reply	[flat|nested] 104+ messages in thread

* Re: [PATCH v9 00/24] ILP32 for ARM64
@ 2019-07-09 22:42   ` Yury Norov
  0 siblings, 0 replies; 104+ messages in thread
From: Yury Norov @ 2019-07-09 22:42 UTC (permalink / raw)
  To: Yury Norov
  Cc: Catalin Marinas, Arnd Bergmann, linux-arm-kernel, linux-kernel,
	linux-doc, linux-arch, linux-api, Adam Borowski, Alexander Graf,
	Alexey Klimov, Andreas Schwab, Andrew Pinski, Bamvor Zhangjian,
	Chris Metcalf, Christoph Muellner, Dave Martin, David S . Miller,
	Florian Weimer, Geert Uytterhoeven, Heiko Carstens, James Hogan

Hi all,

On Wed, May 16, 2018 at 11:18:45AM +0300, Yury Norov wrote:
> This series enables AARCH64 with ILP32 mode.
> 
> As supporting work, it introduces ARCH_32BIT_OFF_T configuration
> option that is enabled for existing 32-bit architectures but disabled
> for new arches (so 64-bit off_t userspace type is used by new userspace).
> Also it deprecates getrlimit and setrlimit syscalls prior to prlimit64.
> 
> Based on kernel v4.16. Tested with LTP, glibc testsuite, trinity, lmbench,
> CPUSpec.
> 
> This series on github: 
> https://github.com/norov/linux/tree/ilp32-4.16
> Linaro toolchain:
> http://snapshots.linaro.org/components/toolchain/binaries/7.3-2018.04-rc1/aarch64-linux-gnu_ilp32/
> Debian repo:
> http://people.linaro.org/~wookey/ilp32/
> OpenSUSE repo:
> https://build.opensuse.org/project/show/devel:ARM:Factory:Contrib:ILP32
> 
> Changes:
> v3: https://lkml.org/lkml/2014/9/3/704
> v4: https://lkml.org/lkml/2015/4/13/691
> v5: https://lkml.org/lkml/2015/9/29/911
> v6: https://lkml.org/lkml/2016/5/23/661
> v7: https://lkml.org/lkml/2017/1/9/213
> v8: https://lkml.org/lkml/2017/6/19/624
> v9: - rebased on top of v4.16;
>     - signal subsystem reworked to avoid code duplication, as requested
>       by Dave Martin (patches 18 and 20);
>     - new files introduced in series use SPDX notation for license;
>     - linux-api and linux-arch CCed as the series changes kernel ABI;
>     - checkpatch and other minor fixes.
>     - Zhou Chengming's reported-by for patch 2 and signed-off-by for
>       patch 21 removed because his email became invalid. Zhou, please
>       share your new email.

This is a 5.2-based version of series.
https://github.com/norov/linux/tree/ilp32-5.2

Thanks,
Yury

^ permalink raw reply	[flat|nested] 104+ messages in thread

* Re: [PATCH v9 00/24] ILP32 for ARM64
@ 2019-07-09 22:42   ` Yury Norov
  0 siblings, 0 replies; 104+ messages in thread
From: Yury Norov @ 2019-07-09 22:42 UTC (permalink / raw)
  To: Yury Norov
  Cc: linux-doc, Szabolcs Nagy, Catalin Marinas, Heiko Carstens,
	Philipp Tomsich, Joseph Myers, linux-arch, Steve Ellcey,
	Prasun Kapoor, Andreas Schwab, Alexander Graf,
	Geert Uytterhoeven, Bamvor Zhangjian, Dave Martin, Adam Borowski,
	Manuel Montezelo, James Hogan, Chris Metcalf, Arnd Bergmann,
	Andrew Pinski, Lin Yongting, Alexey Klimov, Mark Brown,
	linux-arm-kernel, Maxim Kuvyrkov, Florian Weimer, linux-api,
	Nathan_Lynch, linux-kernel, James Morse, Ramana Radhakrishnan,
	Martin Schwidefsky, David S . Miller, Christoph Muellner

Hi all,

On Wed, May 16, 2018 at 11:18:45AM +0300, Yury Norov wrote:
> This series enables AARCH64 with ILP32 mode.
> 
> As supporting work, it introduces ARCH_32BIT_OFF_T configuration
> option that is enabled for existing 32-bit architectures but disabled
> for new arches (so 64-bit off_t userspace type is used by new userspace).
> Also it deprecates getrlimit and setrlimit syscalls prior to prlimit64.
> 
> Based on kernel v4.16. Tested with LTP, glibc testsuite, trinity, lmbench,
> CPUSpec.
> 
> This series on github: 
> https://github.com/norov/linux/tree/ilp32-4.16
> Linaro toolchain:
> http://snapshots.linaro.org/components/toolchain/binaries/7.3-2018.04-rc1/aarch64-linux-gnu_ilp32/
> Debian repo:
> http://people.linaro.org/~wookey/ilp32/
> OpenSUSE repo:
> https://build.opensuse.org/project/show/devel:ARM:Factory:Contrib:ILP32
> 
> Changes:
> v3: https://lkml.org/lkml/2014/9/3/704
> v4: https://lkml.org/lkml/2015/4/13/691
> v5: https://lkml.org/lkml/2015/9/29/911
> v6: https://lkml.org/lkml/2016/5/23/661
> v7: https://lkml.org/lkml/2017/1/9/213
> v8: https://lkml.org/lkml/2017/6/19/624
> v9: - rebased on top of v4.16;
>     - signal subsystem reworked to avoid code duplication, as requested
>       by Dave Martin (patches 18 and 20);
>     - new files introduced in series use SPDX notation for license;
>     - linux-api and linux-arch CCed as the series changes kernel ABI;
>     - checkpatch and other minor fixes.
>     - Zhou Chengming's reported-by for patch 2 and signed-off-by for
>       patch 21 removed because his email became invalid. Zhou, please
>       share your new email.

This is a 5.2-based version of series.
https://github.com/norov/linux/tree/ilp32-5.2

Thanks,
Yury

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply	[flat|nested] 104+ messages in thread

* Re: [PATCH v9 00/24] ILP32 for ARM64
  2019-05-08 22:59   ` Yury Norov
  (?)
@ 2019-05-13  8:48     ` Andreas Schwab
  -1 siblings, 0 replies; 104+ messages in thread
From: Andreas Schwab @ 2019-05-13  8:48 UTC (permalink / raw)
  To: Yury Norov
  Cc: Yury Norov, Catalin Marinas, Arnd Bergmann, linux-arm-kernel,
	linux-kernel, linux-doc, linux-arch, linux-api, Adam Borowski,
	Alexander Graf, Alexey Klimov, Andrew Pinski, Bamvor Zhangjian,
	Chris Metcalf, Christoph Muellner, Dave Martin, David S . Miller,
	Florian Weimer, Geert Uytterhoeven, Heiko Carstens, James Hogan,
	James Morse, Joseph Myers, Lin Yongting, Manuel Montezelo,
	Mark Brown, Martin Schwidefsky, Maxim Kuvyrkov, Nathan_Lynch,
	Philipp Tomsich, Prasun Kapoor, Ramana Radhakrishnan,
	Steve Ellcey, Szabolcs Nagy

There is a problem with the stack size accounting during execve when
there is no stack limit:

$ ulimit -s
8192
$ ./hello.ilp32 
Hello World!
$ ulimit -s unlimited
$ ./hello.ilp32 
Segmentation fault
$ strace ./hello.ilp32 
execve("./hello.ilp32", ["./hello.ilp32"], 0xfffff10548f0 /* 77 vars */) = -1 ENOMEM (Cannot allocate memory)
+++ killed by SIGSEGV +++
Segmentation fault (core dumped)

Andreas.

-- 
Andreas Schwab, SUSE Labs, schwab@suse.de
GPG Key fingerprint = 0196 BAD8 1CE9 1970 F4BE  1748 E4D4 88E3 0EEA B9D7
"And now for something completely different."

^ permalink raw reply	[flat|nested] 104+ messages in thread

* Re: [PATCH v9 00/24] ILP32 for ARM64
@ 2019-05-13  8:48     ` Andreas Schwab
  0 siblings, 0 replies; 104+ messages in thread
From: Andreas Schwab @ 2019-05-13  8:48 UTC (permalink / raw)
  To: Yury Norov
  Cc: Yury Norov, Catalin Marinas, Arnd Bergmann, linux-arm-kernel,
	linux-kernel, linux-doc, linux-arch, linux-api, Adam Borowski,
	Alexander Graf, Alexey Klimov, Andrew Pinski, Bamvor Zhangjian,
	Chris Metcalf, Christoph Muellner, Dave Martin, David S . Miller,
	Florian Weimer, Geert Uytterhoeven, Heiko Carstens, James

There is a problem with the stack size accounting during execve when
there is no stack limit:

$ ulimit -s
8192
$ ./hello.ilp32 
Hello World!
$ ulimit -s unlimited
$ ./hello.ilp32 
Segmentation fault
$ strace ./hello.ilp32 
execve("./hello.ilp32", ["./hello.ilp32"], 0xfffff10548f0 /* 77 vars */) = -1 ENOMEM (Cannot allocate memory)
+++ killed by SIGSEGV +++
Segmentation fault (core dumped)

Andreas.

-- 
Andreas Schwab, SUSE Labs, schwab@suse.de
GPG Key fingerprint = 0196 BAD8 1CE9 1970 F4BE  1748 E4D4 88E3 0EEA B9D7
"And now for something completely different."

^ permalink raw reply	[flat|nested] 104+ messages in thread

* Re: [PATCH v9 00/24] ILP32 for ARM64
@ 2019-05-13  8:48     ` Andreas Schwab
  0 siblings, 0 replies; 104+ messages in thread
From: Andreas Schwab @ 2019-05-13  8:48 UTC (permalink / raw)
  To: Yury Norov
  Cc: linux-doc, Szabolcs Nagy, Catalin Marinas, Heiko Carstens,
	Yury Norov, Philipp Tomsich, Joseph Myers, linux-arch,
	Steve Ellcey, Prasun Kapoor, Alexander Graf, Bamvor Zhangjian,
	Geert Uytterhoeven, Dave Martin, Adam Borowski, Manuel Montezelo,
	James Hogan, Chris Metcalf, Arnd Bergmann, Andrew Pinski,
	Lin Yongting, Alexey Klimov, Mark Brown, linux-arm-kernel,
	Maxim Kuvyrkov, Florian Weimer, linux-api, Nathan_Lynch,
	linux-kernel, James Morse, Ramana Radhakrishnan,
	Martin Schwidefsky, David S . Miller, Christoph Muellner

There is a problem with the stack size accounting during execve when
there is no stack limit:

$ ulimit -s
8192
$ ./hello.ilp32 
Hello World!
$ ulimit -s unlimited
$ ./hello.ilp32 
Segmentation fault
$ strace ./hello.ilp32 
execve("./hello.ilp32", ["./hello.ilp32"], 0xfffff10548f0 /* 77 vars */) = -1 ENOMEM (Cannot allocate memory)
+++ killed by SIGSEGV +++
Segmentation fault (core dumped)

Andreas.

-- 
Andreas Schwab, SUSE Labs, schwab@suse.de
GPG Key fingerprint = 0196 BAD8 1CE9 1970 F4BE  1748 E4D4 88E3 0EEA B9D7
"And now for something completely different."

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply	[flat|nested] 104+ messages in thread

* Re: [PATCH v9 00/24] ILP32 for ARM64
  2019-05-08 22:59   ` Yury Norov
  (?)
@ 2019-05-08 23:10     ` Yury Norov
  -1 siblings, 0 replies; 104+ messages in thread
From: Yury Norov @ 2019-05-08 23:10 UTC (permalink / raw)
  To: Yury Norov
  Cc: Catalin Marinas, Arnd Bergmann, linux-arm-kernel, linux-kernel,
	linux-doc, linux-arch, linux-api, Adam Borowski, Alexander Graf,
	Alexey Klimov, Andreas Schwab, Andrew Pinski, Bamvor Zhangjian,
	Chris Metcalf, Christoph Muellner, Dave Martin, David S . Miller,
	Florian Weimer, Geert Uytterhoeven, Heiko Carstens, James Hogan,
	James Morse, Joseph Myers, Lin Yongting, Manuel Montezelo,
	Mark Brown, Martin Schwidefsky, Maxim Kuvyrkov, Nathan_Lynch,
	Philipp Tomsich, Prasun Kapoor, Ramana Radhakrishnan,
	Steve Ellcey, Szabolcs Nagy, Yury Norov, Yury Norov

On Wed, May 08, 2019 at 03:59:00PM -0700, Yury Norov wrote:
> Hi all,
> 
> On Wed, May 16, 2018 at 11:18:45AM +0300, Yury Norov wrote:
> > This series enables AARCH64 with ILP32 mode.
> > 
> > As supporting work, it introduces ARCH_32BIT_OFF_T configuration
> > option that is enabled for existing 32-bit architectures but disabled
> > for new arches (so 64-bit off_t userspace type is used by new userspace).
> > Also it deprecates getrlimit and setrlimit syscalls prior to prlimit64.
> > 
> > Based on kernel v4.16. Tested with LTP, glibc testsuite, trinity, lmbench,
> > CPUSpec.
> > 
> > This series on github: 
> > https://github.com/norov/linux/tree/ilp32-4.16
> > Linaro toolchain:
> > http://snapshots.linaro.org/components/toolchain/binaries/7.3-2018.04-rc1/aarch64-linux-gnu_ilp32/
> > Debian repo:
> > http://people.linaro.org/~wookey/ilp32/
> > OpenSUSE repo:
> > https://build.opensuse.org/project/show/devel:ARM:Factory:Contrib:ILP32
> 
> This is the 5.1-based version.
> Changes comparing to 5.0:
>  - drop arch patches that has been taken upstream:
>    80d7da1cac62 asm-generic: Drop getrlimit and setrlimit syscalls from default list
>    942fa985e9f1 32-bit userspace ABI: introduce ARCH_32BIT_OFF_T config option
>    0d0216c03a7a compat ABI: use non-compat openat and open_by_handle_at variants
>  - in include/linux/thread_bits.h define current_thread_info() prior to
>    inclusion of asm/thread_info.h, to avoid circullar dependencies (thread: move
>    thread bits accessors to separated file);
>  - enable old IPC interfaces for ilp32, according to mainline changes
>    (arm64: ilp32: introduce syscall table for ILP32).

Missed link:
https://github.com/norov/linux/tree/ilp32-5.1

> 
> Thanks,
> Yury

^ permalink raw reply	[flat|nested] 104+ messages in thread

* Re: [PATCH v9 00/24] ILP32 for ARM64
@ 2019-05-08 23:10     ` Yury Norov
  0 siblings, 0 replies; 104+ messages in thread
From: Yury Norov @ 2019-05-08 23:10 UTC (permalink / raw)
  To: Yury Norov
  Cc: Catalin Marinas, Arnd Bergmann, linux-arm-kernel, linux-kernel,
	linux-doc, linux-arch, linux-api, Adam Borowski, Alexander Graf,
	Alexey Klimov, Andreas Schwab, Andrew Pinski, Bamvor Zhangjian,
	Chris Metcalf, Christoph Muellner, Dave Martin, David S . Miller,
	Florian Weimer, Geert Uytterhoeven, Heiko Carstens, James Hogan

On Wed, May 08, 2019 at 03:59:00PM -0700, Yury Norov wrote:
> Hi all,
> 
> On Wed, May 16, 2018 at 11:18:45AM +0300, Yury Norov wrote:
> > This series enables AARCH64 with ILP32 mode.
> > 
> > As supporting work, it introduces ARCH_32BIT_OFF_T configuration
> > option that is enabled for existing 32-bit architectures but disabled
> > for new arches (so 64-bit off_t userspace type is used by new userspace).
> > Also it deprecates getrlimit and setrlimit syscalls prior to prlimit64.
> > 
> > Based on kernel v4.16. Tested with LTP, glibc testsuite, trinity, lmbench,
> > CPUSpec.
> > 
> > This series on github: 
> > https://github.com/norov/linux/tree/ilp32-4.16
> > Linaro toolchain:
> > http://snapshots.linaro.org/components/toolchain/binaries/7.3-2018.04-rc1/aarch64-linux-gnu_ilp32/
> > Debian repo:
> > http://people.linaro.org/~wookey/ilp32/
> > OpenSUSE repo:
> > https://build.opensuse.org/project/show/devel:ARM:Factory:Contrib:ILP32
> 
> This is the 5.1-based version.
> Changes comparing to 5.0:
>  - drop arch patches that has been taken upstream:
>    80d7da1cac62 asm-generic: Drop getrlimit and setrlimit syscalls from default list
>    942fa985e9f1 32-bit userspace ABI: introduce ARCH_32BIT_OFF_T config option
>    0d0216c03a7a compat ABI: use non-compat openat and open_by_handle_at variants
>  - in include/linux/thread_bits.h define current_thread_info() prior to
>    inclusion of asm/thread_info.h, to avoid circullar dependencies (thread: move
>    thread bits accessors to separated file);
>  - enable old IPC interfaces for ilp32, according to mainline changes
>    (arm64: ilp32: introduce syscall table for ILP32).

Missed link:
https://github.com/norov/linux/tree/ilp32-5.1

> 
> Thanks,
> Yury

^ permalink raw reply	[flat|nested] 104+ messages in thread

* Re: [PATCH v9 00/24] ILP32 for ARM64
@ 2019-05-08 23:10     ` Yury Norov
  0 siblings, 0 replies; 104+ messages in thread
From: Yury Norov @ 2019-05-08 23:10 UTC (permalink / raw)
  To: Yury Norov
  Cc: linux-doc, Szabolcs Nagy, Catalin Marinas, Heiko Carstens,
	Yury Norov, Philipp Tomsich, Joseph Myers, linux-arch,
	Steve Ellcey, Yury Norov, Prasun Kapoor, Andreas Schwab,
	Alexander Graf, Geert Uytterhoeven, Bamvor Zhangjian,
	Dave Martin, Adam Borowski, Manuel Montezelo, James Hogan,
	Chris Metcalf, Arnd Bergmann, Andrew Pinski, Lin Yongting,
	Alexey Klimov, Mark Brown, linux-arm-kernel, Maxim Kuvyrkov,
	Florian Weimer, linux-api, Nathan_Lynch, linux-kernel,
	James Morse, Ramana Radhakrishnan, Martin Schwidefsky,
	David S . Miller, Christoph Muellner

On Wed, May 08, 2019 at 03:59:00PM -0700, Yury Norov wrote:
> Hi all,
> 
> On Wed, May 16, 2018 at 11:18:45AM +0300, Yury Norov wrote:
> > This series enables AARCH64 with ILP32 mode.
> > 
> > As supporting work, it introduces ARCH_32BIT_OFF_T configuration
> > option that is enabled for existing 32-bit architectures but disabled
> > for new arches (so 64-bit off_t userspace type is used by new userspace).
> > Also it deprecates getrlimit and setrlimit syscalls prior to prlimit64.
> > 
> > Based on kernel v4.16. Tested with LTP, glibc testsuite, trinity, lmbench,
> > CPUSpec.
> > 
> > This series on github: 
> > https://github.com/norov/linux/tree/ilp32-4.16
> > Linaro toolchain:
> > http://snapshots.linaro.org/components/toolchain/binaries/7.3-2018.04-rc1/aarch64-linux-gnu_ilp32/
> > Debian repo:
> > http://people.linaro.org/~wookey/ilp32/
> > OpenSUSE repo:
> > https://build.opensuse.org/project/show/devel:ARM:Factory:Contrib:ILP32
> 
> This is the 5.1-based version.
> Changes comparing to 5.0:
>  - drop arch patches that has been taken upstream:
>    80d7da1cac62 asm-generic: Drop getrlimit and setrlimit syscalls from default list
>    942fa985e9f1 32-bit userspace ABI: introduce ARCH_32BIT_OFF_T config option
>    0d0216c03a7a compat ABI: use non-compat openat and open_by_handle_at variants
>  - in include/linux/thread_bits.h define current_thread_info() prior to
>    inclusion of asm/thread_info.h, to avoid circullar dependencies (thread: move
>    thread bits accessors to separated file);
>  - enable old IPC interfaces for ilp32, according to mainline changes
>    (arm64: ilp32: introduce syscall table for ILP32).

Missed link:
https://github.com/norov/linux/tree/ilp32-5.1

> 
> Thanks,
> Yury

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply	[flat|nested] 104+ messages in thread

* Re: [PATCH v9 00/24] ILP32 for ARM64
  2018-05-16  8:18 ` Yury Norov
  (?)
@ 2019-05-08 22:59   ` Yury Norov
  -1 siblings, 0 replies; 104+ messages in thread
From: Yury Norov @ 2019-05-08 22:59 UTC (permalink / raw)
  To: Yury Norov
  Cc: Catalin Marinas, Arnd Bergmann, linux-arm-kernel, linux-kernel,
	linux-doc, linux-arch, linux-api, Adam Borowski, Alexander Graf,
	Alexey Klimov, Andreas Schwab, Andrew Pinski, Bamvor Zhangjian,
	Chris Metcalf, Christoph Muellner, Dave Martin, David S . Miller,
	Florian Weimer, Geert Uytterhoeven, Heiko Carstens, James Hogan,
	James Morse, Joseph Myers, Lin Yongting, Manuel Montezelo,
	Mark Brown, Martin Schwidefsky, Maxim Kuvyrkov, Nathan_Lynch,
	Philipp Tomsich, Prasun Kapoor, Ramana Radhakrishnan,
	Steve Ellcey, Szabolcs Nagy

Hi all,

On Wed, May 16, 2018 at 11:18:45AM +0300, Yury Norov wrote:
> This series enables AARCH64 with ILP32 mode.
> 
> As supporting work, it introduces ARCH_32BIT_OFF_T configuration
> option that is enabled for existing 32-bit architectures but disabled
> for new arches (so 64-bit off_t userspace type is used by new userspace).
> Also it deprecates getrlimit and setrlimit syscalls prior to prlimit64.
> 
> Based on kernel v4.16. Tested with LTP, glibc testsuite, trinity, lmbench,
> CPUSpec.
> 
> This series on github: 
> https://github.com/norov/linux/tree/ilp32-4.16
> Linaro toolchain:
> http://snapshots.linaro.org/components/toolchain/binaries/7.3-2018.04-rc1/aarch64-linux-gnu_ilp32/
> Debian repo:
> http://people.linaro.org/~wookey/ilp32/
> OpenSUSE repo:
> https://build.opensuse.org/project/show/devel:ARM:Factory:Contrib:ILP32

This is the 5.1-based version.
Changes comparing to 5.0:
 - drop arch patches that has been taken upstream:
   80d7da1cac62 asm-generic: Drop getrlimit and setrlimit syscalls from default list
   942fa985e9f1 32-bit userspace ABI: introduce ARCH_32BIT_OFF_T config option
   0d0216c03a7a compat ABI: use non-compat openat and open_by_handle_at variants
 - in include/linux/thread_bits.h define current_thread_info() prior to
   inclusion of asm/thread_info.h, to avoid circullar dependencies (thread: move
   thread bits accessors to separated file);
 - enable old IPC interfaces for ilp32, according to mainline changes
   (arm64: ilp32: introduce syscall table for ILP32).

Thanks,
Yury

^ permalink raw reply	[flat|nested] 104+ messages in thread

* Re: [PATCH v9 00/24] ILP32 for ARM64
@ 2019-05-08 22:59   ` Yury Norov
  0 siblings, 0 replies; 104+ messages in thread
From: Yury Norov @ 2019-05-08 22:59 UTC (permalink / raw)
  To: Yury Norov
  Cc: Catalin Marinas, Arnd Bergmann, linux-arm-kernel, linux-kernel,
	linux-doc, linux-arch, linux-api, Adam Borowski, Alexander Graf,
	Alexey Klimov, Andreas Schwab, Andrew Pinski, Bamvor Zhangjian,
	Chris Metcalf, Christoph Muellner, Dave Martin, David S . Miller,
	Florian Weimer, Geert Uytterhoeven, Heiko Carstens, James Hogan

Hi all,

On Wed, May 16, 2018 at 11:18:45AM +0300, Yury Norov wrote:
> This series enables AARCH64 with ILP32 mode.
> 
> As supporting work, it introduces ARCH_32BIT_OFF_T configuration
> option that is enabled for existing 32-bit architectures but disabled
> for new arches (so 64-bit off_t userspace type is used by new userspace).
> Also it deprecates getrlimit and setrlimit syscalls prior to prlimit64.
> 
> Based on kernel v4.16. Tested with LTP, glibc testsuite, trinity, lmbench,
> CPUSpec.
> 
> This series on github: 
> https://github.com/norov/linux/tree/ilp32-4.16
> Linaro toolchain:
> http://snapshots.linaro.org/components/toolchain/binaries/7.3-2018.04-rc1/aarch64-linux-gnu_ilp32/
> Debian repo:
> http://people.linaro.org/~wookey/ilp32/
> OpenSUSE repo:
> https://build.opensuse.org/project/show/devel:ARM:Factory:Contrib:ILP32

This is the 5.1-based version.
Changes comparing to 5.0:
 - drop arch patches that has been taken upstream:
   80d7da1cac62 asm-generic: Drop getrlimit and setrlimit syscalls from default list
   942fa985e9f1 32-bit userspace ABI: introduce ARCH_32BIT_OFF_T config option
   0d0216c03a7a compat ABI: use non-compat openat and open_by_handle_at variants
 - in include/linux/thread_bits.h define current_thread_info() prior to
   inclusion of asm/thread_info.h, to avoid circullar dependencies (thread: move
   thread bits accessors to separated file);
 - enable old IPC interfaces for ilp32, according to mainline changes
   (arm64: ilp32: introduce syscall table for ILP32).

Thanks,
Yury

^ permalink raw reply	[flat|nested] 104+ messages in thread

* Re: [PATCH v9 00/24] ILP32 for ARM64
@ 2019-05-08 22:59   ` Yury Norov
  0 siblings, 0 replies; 104+ messages in thread
From: Yury Norov @ 2019-05-08 22:59 UTC (permalink / raw)
  To: Yury Norov
  Cc: linux-doc, Szabolcs Nagy, Catalin Marinas, Heiko Carstens,
	Philipp Tomsich, Joseph Myers, linux-arch, Steve Ellcey,
	Prasun Kapoor, Andreas Schwab, Alexander Graf,
	Geert Uytterhoeven, Bamvor Zhangjian, Dave Martin, Adam Borowski,
	Manuel Montezelo, James Hogan, Chris Metcalf, Arnd Bergmann,
	Andrew Pinski, Lin Yongting, Alexey Klimov, Mark Brown,
	linux-arm-kernel, Maxim Kuvyrkov, Florian Weimer, linux-api,
	Nathan_Lynch, linux-kernel, James Morse, Ramana Radhakrishnan,
	Martin Schwidefsky, David S . Miller, Christoph Muellner

Hi all,

On Wed, May 16, 2018 at 11:18:45AM +0300, Yury Norov wrote:
> This series enables AARCH64 with ILP32 mode.
> 
> As supporting work, it introduces ARCH_32BIT_OFF_T configuration
> option that is enabled for existing 32-bit architectures but disabled
> for new arches (so 64-bit off_t userspace type is used by new userspace).
> Also it deprecates getrlimit and setrlimit syscalls prior to prlimit64.
> 
> Based on kernel v4.16. Tested with LTP, glibc testsuite, trinity, lmbench,
> CPUSpec.
> 
> This series on github: 
> https://github.com/norov/linux/tree/ilp32-4.16
> Linaro toolchain:
> http://snapshots.linaro.org/components/toolchain/binaries/7.3-2018.04-rc1/aarch64-linux-gnu_ilp32/
> Debian repo:
> http://people.linaro.org/~wookey/ilp32/
> OpenSUSE repo:
> https://build.opensuse.org/project/show/devel:ARM:Factory:Contrib:ILP32

This is the 5.1-based version.
Changes comparing to 5.0:
 - drop arch patches that has been taken upstream:
   80d7da1cac62 asm-generic: Drop getrlimit and setrlimit syscalls from default list
   942fa985e9f1 32-bit userspace ABI: introduce ARCH_32BIT_OFF_T config option
   0d0216c03a7a compat ABI: use non-compat openat and open_by_handle_at variants
 - in include/linux/thread_bits.h define current_thread_info() prior to
   inclusion of asm/thread_info.h, to avoid circullar dependencies (thread: move
   thread bits accessors to separated file);
 - enable old IPC interfaces for ilp32, according to mainline changes
   (arm64: ilp32: introduce syscall table for ILP32).

Thanks,
Yury

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply	[flat|nested] 104+ messages in thread

* Re: [PATCH v9 00/24] ILP32 for ARM64
  2018-05-16  8:18 ` Yury Norov
  (?)
@ 2019-03-05 20:56   ` Yury Norov
  -1 siblings, 0 replies; 104+ messages in thread
From: Yury Norov @ 2019-03-05 20:56 UTC (permalink / raw)
  To: Yury Norov
  Cc: Catalin Marinas, Arnd Bergmann, linux-arm-kernel, linux-kernel,
	linux-doc, linux-arch, linux-api, Adam Borowski, Alexander Graf,
	Alexey Klimov, Andreas Schwab, Andrew Pinski, Bamvor Zhangjian,
	Chris Metcalf, Christoph Muellner, Dave Martin, David S . Miller,
	Florian Weimer, Geert Uytterhoeven, Heiko Carstens, James Hogan,
	James Morse, Joseph Myers, Lin Yongting, Manuel Montezelo,
	Mark Brown, Martin Schwidefsky, Maxim Kuvyrkov, Nathan_Lynch,
	Philipp Tomsich, Prasun Kapoor, Ramana Radhakrishnan,
	Steve Ellcey, Szabolcs Nagy, yury.norov

On Wed, May 16, 2018 at 11:18:45AM +0300, Yury Norov wrote:
> This series enables AARCH64 with ILP32 mode.
> 
> As supporting work, it introduces ARCH_32BIT_OFF_T configuration
> option that is enabled for existing 32-bit architectures but disabled
> for new arches (so 64-bit off_t userspace type is used by new userspace).
> Also it deprecates getrlimit and setrlimit syscalls prior to prlimit64.
> 
> Based on kernel v4.16. Tested with LTP, glibc testsuite, trinity, lmbench,
> CPUSpec.
> 
> This series on github: 
> https://github.com/norov/linux/tree/ilp32-4.16
> Linaro toolchain:
> http://snapshots.linaro.org/components/toolchain/binaries/7.3-2018.04-rc1/aarch64-linux-gnu_ilp32/
> Debian repo:
> http://people.linaro.org/~wookey/ilp32/
> OpenSUSE repo:
> https://build.opensuse.org/project/show/devel:ARM:Factory:Contrib:ILP32
> 
> Changes:
> v3: https://lkml.org/lkml/2014/9/3/704
> v4: https://lkml.org/lkml/2015/4/13/691
> v5: https://lkml.org/lkml/2015/9/29/911
> v6: https://lkml.org/lkml/2016/5/23/661
> v7: https://lkml.org/lkml/2017/1/9/213
> v8: https://lkml.org/lkml/2017/6/19/624
> v9: - rebased on top of v4.16;
>     - signal subsystem reworked to avoid code duplication, as requested
>       by Dave Martin (patches 18 and 20);
>     - new files introduced in series use SPDX notation for license;
>     - linux-api and linux-arch CCed as the series changes kernel ABI;
>     - checkpatch and other minor fixes.
>     - Zhou Chengming's reported-by for patch 2 and signed-off-by for
>       patch 21 removed because his email became invalid. Zhou, please
>       share your new email.

Hi all,

This is the 5.0-based version.
https://github.com/norov/linux/tree/ilp32-5.0

Since 4.20:
 - all new files are consistently GPL2.0-licensed;
 - AUDIT_ARCH_AARCH64ILP32 added to let syscall_get_arch()
   differentiate ARM64/ILP32 from ARM64/ILP32.

Yury

^ permalink raw reply	[flat|nested] 104+ messages in thread

* Re: [PATCH v9 00/24] ILP32 for ARM64
@ 2019-03-05 20:56   ` Yury Norov
  0 siblings, 0 replies; 104+ messages in thread
From: Yury Norov @ 2019-03-05 20:56 UTC (permalink / raw)
  To: Yury Norov
  Cc: Catalin Marinas, Arnd Bergmann, linux-arm-kernel, linux-kernel,
	linux-doc, linux-arch, linux-api, Adam Borowski, Alexander Graf,
	Alexey Klimov, Andreas Schwab, Andrew Pinski, Bamvor Zhangjian,
	Chris Metcalf, Christoph Muellner, Dave Martin, David S . Miller,
	Florian Weimer, Geert Uytterhoeven, Heiko Carstens, James Hogan

On Wed, May 16, 2018 at 11:18:45AM +0300, Yury Norov wrote:
> This series enables AARCH64 with ILP32 mode.
> 
> As supporting work, it introduces ARCH_32BIT_OFF_T configuration
> option that is enabled for existing 32-bit architectures but disabled
> for new arches (so 64-bit off_t userspace type is used by new userspace).
> Also it deprecates getrlimit and setrlimit syscalls prior to prlimit64.
> 
> Based on kernel v4.16. Tested with LTP, glibc testsuite, trinity, lmbench,
> CPUSpec.
> 
> This series on github: 
> https://github.com/norov/linux/tree/ilp32-4.16
> Linaro toolchain:
> http://snapshots.linaro.org/components/toolchain/binaries/7.3-2018.04-rc1/aarch64-linux-gnu_ilp32/
> Debian repo:
> http://people.linaro.org/~wookey/ilp32/
> OpenSUSE repo:
> https://build.opensuse.org/project/show/devel:ARM:Factory:Contrib:ILP32
> 
> Changes:
> v3: https://lkml.org/lkml/2014/9/3/704
> v4: https://lkml.org/lkml/2015/4/13/691
> v5: https://lkml.org/lkml/2015/9/29/911
> v6: https://lkml.org/lkml/2016/5/23/661
> v7: https://lkml.org/lkml/2017/1/9/213
> v8: https://lkml.org/lkml/2017/6/19/624
> v9: - rebased on top of v4.16;
>     - signal subsystem reworked to avoid code duplication, as requested
>       by Dave Martin (patches 18 and 20);
>     - new files introduced in series use SPDX notation for license;
>     - linux-api and linux-arch CCed as the series changes kernel ABI;
>     - checkpatch and other minor fixes.
>     - Zhou Chengming's reported-by for patch 2 and signed-off-by for
>       patch 21 removed because his email became invalid. Zhou, please
>       share your new email.

Hi all,

This is the 5.0-based version.
https://github.com/norov/linux/tree/ilp32-5.0

Since 4.20:
 - all new files are consistently GPL2.0-licensed;
 - AUDIT_ARCH_AARCH64ILP32 added to let syscall_get_arch()
   differentiate ARM64/ILP32 from ARM64/ILP32.

Yury

^ permalink raw reply	[flat|nested] 104+ messages in thread

* Re: [PATCH v9 00/24] ILP32 for ARM64
@ 2019-03-05 20:56   ` Yury Norov
  0 siblings, 0 replies; 104+ messages in thread
From: Yury Norov @ 2019-03-05 20:56 UTC (permalink / raw)
  To: Yury Norov
  Cc: linux-doc, Szabolcs Nagy, Catalin Marinas, Heiko Carstens,
	Philipp Tomsich, Joseph Myers, linux-arch, Steve Ellcey,
	yury.norov, Prasun Kapoor, Andreas Schwab, Alexander Graf,
	Geert Uytterhoeven, Bamvor Zhangjian, Dave Martin, Adam Borowski,
	Manuel Montezelo, James Hogan, Chris Metcalf, Arnd Bergmann,
	Andrew Pinski, Lin Yongting, Alexey Klimov, Mark Brown,
	linux-arm-kernel, Maxim Kuvyrkov, Florian Weimer, linux-api,
	Nathan_Lynch, linux-kernel, James Morse, Ramana Radhakrishnan,
	Martin Schwidefsky, David S . Miller, Christoph Muellner

On Wed, May 16, 2018 at 11:18:45AM +0300, Yury Norov wrote:
> This series enables AARCH64 with ILP32 mode.
> 
> As supporting work, it introduces ARCH_32BIT_OFF_T configuration
> option that is enabled for existing 32-bit architectures but disabled
> for new arches (so 64-bit off_t userspace type is used by new userspace).
> Also it deprecates getrlimit and setrlimit syscalls prior to prlimit64.
> 
> Based on kernel v4.16. Tested with LTP, glibc testsuite, trinity, lmbench,
> CPUSpec.
> 
> This series on github: 
> https://github.com/norov/linux/tree/ilp32-4.16
> Linaro toolchain:
> http://snapshots.linaro.org/components/toolchain/binaries/7.3-2018.04-rc1/aarch64-linux-gnu_ilp32/
> Debian repo:
> http://people.linaro.org/~wookey/ilp32/
> OpenSUSE repo:
> https://build.opensuse.org/project/show/devel:ARM:Factory:Contrib:ILP32
> 
> Changes:
> v3: https://lkml.org/lkml/2014/9/3/704
> v4: https://lkml.org/lkml/2015/4/13/691
> v5: https://lkml.org/lkml/2015/9/29/911
> v6: https://lkml.org/lkml/2016/5/23/661
> v7: https://lkml.org/lkml/2017/1/9/213
> v8: https://lkml.org/lkml/2017/6/19/624
> v9: - rebased on top of v4.16;
>     - signal subsystem reworked to avoid code duplication, as requested
>       by Dave Martin (patches 18 and 20);
>     - new files introduced in series use SPDX notation for license;
>     - linux-api and linux-arch CCed as the series changes kernel ABI;
>     - checkpatch and other minor fixes.
>     - Zhou Chengming's reported-by for patch 2 and signed-off-by for
>       patch 21 removed because his email became invalid. Zhou, please
>       share your new email.

Hi all,

This is the 5.0-based version.
https://github.com/norov/linux/tree/ilp32-5.0

Since 4.20:
 - all new files are consistently GPL2.0-licensed;
 - AUDIT_ARCH_AARCH64ILP32 added to let syscall_get_arch()
   differentiate ARM64/ILP32 from ARM64/ILP32.

Yury

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply	[flat|nested] 104+ messages in thread

* Re: [PATCH v9 00/24] ILP32 for ARM64
       [not found]   ` <DC9A951E-B638-4820-8499-02D5322E7DF7@amacapital.net>
  2019-01-07 20:43       ` Yuri Norov
  (?)
@ 2019-01-07 20:43       ` Yuri Norov
  0 siblings, 0 replies; 104+ messages in thread
From: Yuri Norov @ 2019-01-07 20:43 UTC (permalink / raw)
  To: Andy Lutomirski
  Cc: Catalin Marinas, Arnd Bergmann, linux-arm-kernel, linux-kernel,
	linux-doc, linux-arch, linux-api, Adam Borowski, Alexander Graf,
	Alexey Klimov, Andreas Schwab, Andrew Pinski, Bamvor Zhangjian,
	Chris Metcalf, Christoph Muellner, Dave Martin, David S . Miller,
	Florian Weimer, Geert Uytterhoeven, Heiko Carstens, James Hogan,
	James Morse, Joseph Myers, Lin Yongting, Manuel Montezelo,
	Mark Brown, Martin Schwidefsky, Maxim Kuvyrkov, Nathan_Lynch,
	Philipp Tomsich, Prasun Kapoor, Ramana Radhakrishnan,
	Steve Ellcey, Szabolcs Nagy, yury.norov

On Mon, Jan 07, 2019 at 09:48:44AM -0800, Andy Lutomirski wrote:
> 
> 
> > On Jan 7, 2019, at 7:50 AM, Yuri Norov <ynorov@marvell.com> wrote:
> > 
> > Hi all,
> > 
> >> On Wed, May 16, 2018 at 11:18:45AM +0300, Yury Norov wrote:
> >> This series enables AARCH64 with ILP32 mode.
> >> 
> >> As supporting work, it introduces ARCH_32BIT_OFF_T configuration
> >> option that is enabled for existing 32-bit architectures but disabled
> >> for new arches (so 64-bit off_t userspace type is used by new userspace).
> >> Also it deprecates getrlimit and setrlimit syscalls prior to prlimit64.
> >> 
> >> Based on kernel v4.16. Tested with LTP, glibc testsuite, trinity, lmbench,
> >> CPUSpec.
> >> 
> >> This series on github: 
> >> https://github.com/norov/linux/tree/ilp32-4.16
> >> Linaro toolchain:
> >> http://snapshots.linaro.org/components/toolchain/binaries/7.3-2018.04-rc1/aarch64-linux-gnu_ilp32/
> >> Debian repo:
> >> http://people.linaro.org/~wookey/ilp32/
> >> OpenSUSE repo:
> >> https://build.opensuse.org/project/show/devel:ARM:Factory:Contrib:ILP32
> >> 
> >> Changes:
> >> v3: https://lkml.org/lkml/2014/9/3/704
> >> v4: https://lkml.org/lkml/2015/4/13/691
> >> v5: https://lkml.org/lkml/2015/9/29/911
> >> v6: https://lkml.org/lkml/2016/5/23/661
> >> v7: https://lkml.org/lkml/2017/1/9/213
> >> v8: https://lkml.org/lkml/2017/6/19/624
> >> v9: - rebased on top of v4.16;
> >>    - signal subsystem reworked to avoid code duplication, as requested
> >>      by Dave Martin (patches 18 and 20);
> >>    - new files introduced in series use SPDX notation for license;
> >>    - linux-api and linux-arch CCed as the series changes kernel ABI;
> >>    - checkpatch and other minor fixes.
> >>    - Zhou Chengming's reported-by for patch 2 and signed-off-by for
> >>      patch 21 removed because his email became invalid. Zhou, please
> >>      share your new email.
> > 
> > This is 4.20-based version.
> > https://github.com/norov/linux/tree/ilp32-4.20
> > 
> > There's no important changes comparing to 4.19, but I would like to remind
> > that this series contains some generic arch patches that ACKed, but still
> > not upstreamed:
> > Yury Norov      asm-generic: Drop getrlimit and setrlimit syscalls from default list
> > Yury Norov      32-bit userspace ABI: introduce ARCH_32BIT_OFF_T config option
> > Yury Norov      compat ABI: use non-compat openat and open_by_handle_at variants
> > James Morse     ptrace: Add compat PTRACE_{G,S}ETSIGMASK handlers
> > Dave Martin     arm64: signal: Make parse_user_sigframe() independent of rt_sigframe layout
> > 
> > Please also notice that my email address is changed, from now it's
> > ynorov@marvell.com
> > 
> 
> Having spent some time hating x32 lately, here is a cursory review:

I followed the recent discussion on x32 drop, but I don't track the story
from the beginning. Can you summarize your complains here (or maybe in
patch for Documentation)? It will be good for ilp32 because we will check
the series against all possible problems, and it will be good for history
because future compat architectures developers will be aware.

On your following questions, I'll try answer according to my understanding.
If it's wrong or incomplete, I kindly ask others fix me.

> You say “ILP32 has context-related structures different from both aarch32 and
> aarch64/lp64.”  Why?  Why not just use the lp64 context structure?

Because the alternative is nothing better than how we do now. We can make
rt_sigframe for ilp32 look exactly like lp64. But on user side we will
have to add pads therefore. On the kernel side, before passing rt_sigframe
to kernel, we will have to make sure that pads are zeroed, just like we do
with x0-x7 in delouse_pt_regs() before passing syscall arguments to handlers.
So we cannot get rid of get/set_sigframe() converters in this case.

Current approach lets us keep user part looking more natural, and on
kernel side we don't add complexity because we reuse existing aarch32
or existing lp64 handlers, and don't invent something new.

> Do you have some objection to letting greg_t be a u64 on ilp32?

In binfmt_ilp32.c we
        #define compat_elf_gregset_t    elf_gregset_t
So in fact we use 64-bit gregset. Or I misunderstood you?

> Since you can’t tell LP64 and ILP32 syscalls apart by number, you need to add
> and wire up a new AUDIT_ARCH value for ILP32. syscall_get_arch() needs to work correctly.

Thanks for pointing to this. I'll append AUDIT_ARCH patch to this series.

Yury

^ permalink raw reply	[flat|nested] 104+ messages in thread

* Re: [PATCH v9 00/24] ILP32 for ARM64
@ 2019-01-07 20:43       ` Yuri Norov
  0 siblings, 0 replies; 104+ messages in thread
From: Yuri Norov @ 2019-01-07 20:43 UTC (permalink / raw)
  To: Andy Lutomirski
  Cc: linux-doc, Szabolcs Nagy, Catalin Marinas, Heiko Carstens,
	Philipp Tomsich, Joseph Myers, linux-arch, Steve Ellcey,
	yury.norov, Prasun Kapoor, Andreas Schwab, Alexander Graf,
	Geert Uytterhoeven, Bamvor Zhangjian, Dave Martin, Adam Borowski,
	Manuel Montezelo, James Hogan, Chris Metcalf, Arnd Bergmann,
	Andrew Pinski

On Mon, Jan 07, 2019 at 09:48:44AM -0800, Andy Lutomirski wrote:
> 
> 
> > On Jan 7, 2019, at 7:50 AM, Yuri Norov <ynorov@marvell.com> wrote:
> > 
> > Hi all,
> > 
> >> On Wed, May 16, 2018 at 11:18:45AM +0300, Yury Norov wrote:
> >> This series enables AARCH64 with ILP32 mode.
> >> 
> >> As supporting work, it introduces ARCH_32BIT_OFF_T configuration
> >> option that is enabled for existing 32-bit architectures but disabled
> >> for new arches (so 64-bit off_t userspace type is used by new userspace).
> >> Also it deprecates getrlimit and setrlimit syscalls prior to prlimit64.
> >> 
> >> Based on kernel v4.16. Tested with LTP, glibc testsuite, trinity, lmbench,
> >> CPUSpec.
> >> 
> >> This series on github: 
> >> https://github.com/norov/linux/tree/ilp32-4.16
> >> Linaro toolchain:
> >> http://snapshots.linaro.org/components/toolchain/binaries/7.3-2018.04-rc1/aarch64-linux-gnu_ilp32/
> >> Debian repo:
> >> http://people.linaro.org/~wookey/ilp32/
> >> OpenSUSE repo:
> >> https://build.opensuse.org/project/show/devel:ARM:Factory:Contrib:ILP32
> >> 
> >> Changes:
> >> v3: https://lkml.org/lkml/2014/9/3/704
> >> v4: https://lkml.org/lkml/2015/4/13/691
> >> v5: https://lkml.org/lkml/2015/9/29/911
> >> v6: https://lkml.org/lkml/2016/5/23/661
> >> v7: https://lkml.org/lkml/2017/1/9/213
> >> v8: https://lkml.org/lkml/2017/6/19/624
> >> v9: - rebased on top of v4.16;
> >>    - signal subsystem reworked to avoid code duplication, as requested
> >>      by Dave Martin (patches 18 and 20);
> >>    - new files introduced in series use SPDX notation for license;
> >>    - linux-api and linux-arch CCed as the series changes kernel ABI;
> >>    - checkpatch and other minor fixes.
> >>    - Zhou Chengming's reported-by for patch 2 and signed-off-by for
> >>      patch 21 removed because his email became invalid. Zhou, please
> >>      share your new email.
> > 
> > This is 4.20-based version.
> > https://github.com/norov/linux/tree/ilp32-4.20
> > 
> > There's no important changes comparing to 4.19, but I would like to remind
> > that this series contains some generic arch patches that ACKed, but still
> > not upstreamed:
> > Yury Norov      asm-generic: Drop getrlimit and setrlimit syscalls from default list
> > Yury Norov      32-bit userspace ABI: introduce ARCH_32BIT_OFF_T config option
> > Yury Norov      compat ABI: use non-compat openat and open_by_handle_at variants
> > James Morse     ptrace: Add compat PTRACE_{G,S}ETSIGMASK handlers
> > Dave Martin     arm64: signal: Make parse_user_sigframe() independent of rt_sigframe layout
> > 
> > Please also notice that my email address is changed, from now it's
> > ynorov@marvell.com
> > 
> 
> Having spent some time hating x32 lately, here is a cursory review:

I followed the recent discussion on x32 drop, but I don't track the story
from the beginning. Can you summarize your complains here (or maybe in
patch for Documentation)? It will be good for ilp32 because we will check
the series against all possible problems, and it will be good for history
because future compat architectures developers will be aware.

On your following questions, I'll try answer according to my understanding.
If it's wrong or incomplete, I kindly ask others fix me.

> You say “ILP32 has context-related structures different from both aarch32 and
> aarch64/lp64.”  Why?  Why not just use the lp64 context structure?

Because the alternative is nothing better than how we do now. We can make
rt_sigframe for ilp32 look exactly like lp64. But on user side we will
have to add pads therefore. On the kernel side, before passing rt_sigframe
to kernel, we will have to make sure that pads are zeroed, just like we do
with x0-x7 in delouse_pt_regs() before passing syscall arguments to handlers.
So we cannot get rid of get/set_sigframe() converters in this case.

Current approach lets us keep user part looking more natural, and on
kernel side we don't add complexity because we reuse existing aarch32
or existing lp64 handlers, and don't invent something new.

> Do you have some objection to letting greg_t be a u64 on ilp32?

In binfmt_ilp32.c we
        #define compat_elf_gregset_t    elf_gregset_t
So in fact we use 64-bit gregset. Or I misunderstood you?

> Since you can’t tell LP64 and ILP32 syscalls apart by number, you need to add
> and wire up a new AUDIT_ARCH value for ILP32. syscall_get_arch() needs to work correctly.

Thanks for pointing to this. I'll append AUDIT_ARCH patch to this series.

Yury
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply	[flat|nested] 104+ messages in thread

* Re: [PATCH v9 00/24] ILP32 for ARM64
@ 2019-01-07 20:43       ` Yuri Norov
  0 siblings, 0 replies; 104+ messages in thread
From: Yuri Norov @ 2019-01-07 20:43 UTC (permalink / raw)
  To: Andy Lutomirski
  Cc: Catalin Marinas, Arnd Bergmann, linux-arm-kernel, linux-kernel,
	linux-doc, linux-arch, linux-api, Adam Borowski, Alexander Graf,
	Alexey Klimov, Andreas Schwab, Andrew Pinski, Bamvor Zhangjian,
	Chris Metcalf, Christoph Muellner, Dave Martin, David S . Miller,
	Florian Weimer, Geert Uytterhoeven, Heiko Carstens, James Hogan,
	James Morse, Joseph Myers, Lin Yongting, Manuel Montezelo,
	Mark Brown, Martin Schwidefsky, Maxim Kuvyrkov, Nathan_Lynch,
	Philipp Tomsich, Prasun Kapoor, Ramana Radhakrishnan,
	Steve Ellcey, Szabolcs Nagy, yury.norov

On Mon, Jan 07, 2019 at 09:48:44AM -0800, Andy Lutomirski wrote:
> 
> 
> > On Jan 7, 2019, at 7:50 AM, Yuri Norov <ynorov@marvell.com> wrote:
> > 
> > Hi all,
> > 
> >> On Wed, May 16, 2018 at 11:18:45AM +0300, Yury Norov wrote:
> >> This series enables AARCH64 with ILP32 mode.
> >> 
> >> As supporting work, it introduces ARCH_32BIT_OFF_T configuration
> >> option that is enabled for existing 32-bit architectures but disabled
> >> for new arches (so 64-bit off_t userspace type is used by new userspace).
> >> Also it deprecates getrlimit and setrlimit syscalls prior to prlimit64.
> >> 
> >> Based on kernel v4.16. Tested with LTP, glibc testsuite, trinity, lmbench,
> >> CPUSpec.
> >> 
> >> This series on github: 
> >> https://github.com/norov/linux/tree/ilp32-4.16
> >> Linaro toolchain:
> >> http://snapshots.linaro.org/components/toolchain/binaries/7.3-2018.04-rc1/aarch64-linux-gnu_ilp32/
> >> Debian repo:
> >> http://people.linaro.org/~wookey/ilp32/
> >> OpenSUSE repo:
> >> https://build.opensuse.org/project/show/devel:ARM:Factory:Contrib:ILP32
> >> 
> >> Changes:
> >> v3: https://lkml.org/lkml/2014/9/3/704
> >> v4: https://lkml.org/lkml/2015/4/13/691
> >> v5: https://lkml.org/lkml/2015/9/29/911
> >> v6: https://lkml.org/lkml/2016/5/23/661
> >> v7: https://lkml.org/lkml/2017/1/9/213
> >> v8: https://lkml.org/lkml/2017/6/19/624
> >> v9: - rebased on top of v4.16;
> >>    - signal subsystem reworked to avoid code duplication, as requested
> >>      by Dave Martin (patches 18 and 20);
> >>    - new files introduced in series use SPDX notation for license;
> >>    - linux-api and linux-arch CCed as the series changes kernel ABI;
> >>    - checkpatch and other minor fixes.
> >>    - Zhou Chengming's reported-by for patch 2 and signed-off-by for
> >>      patch 21 removed because his email became invalid. Zhou, please
> >>      share your new email.
> > 
> > This is 4.20-based version.
> > https://github.com/norov/linux/tree/ilp32-4.20
> > 
> > There's no important changes comparing to 4.19, but I would like to remind
> > that this series contains some generic arch patches that ACKed, but still
> > not upstreamed:
> > Yury Norov      asm-generic: Drop getrlimit and setrlimit syscalls from default list
> > Yury Norov      32-bit userspace ABI: introduce ARCH_32BIT_OFF_T config option
> > Yury Norov      compat ABI: use non-compat openat and open_by_handle_at variants
> > James Morse     ptrace: Add compat PTRACE_{G,S}ETSIGMASK handlers
> > Dave Martin     arm64: signal: Make parse_user_sigframe() independent of rt_sigframe layout
> > 
> > Please also notice that my email address is changed, from now it's
> > ynorov@marvell.com
> > 
> 
> Having spent some time hating x32 lately, here is a cursory review:

I followed the recent discussion on x32 drop, but I don't track the story
from the beginning. Can you summarize your complains here (or maybe in
patch for Documentation)? It will be good for ilp32 because we will check
the series against all possible problems, and it will be good for history
because future compat architectures developers will be aware.

On your following questions, I'll try answer according to my understanding.
If it's wrong or incomplete, I kindly ask others fix me.

> You say “ILP32 has context-related structures different from both aarch32 and
> aarch64/lp64.”  Why?  Why not just use the lp64 context structure?

Because the alternative is nothing better than how we do now. We can make
rt_sigframe for ilp32 look exactly like lp64. But on user side we will
have to add pads therefore. On the kernel side, before passing rt_sigframe
to kernel, we will have to make sure that pads are zeroed, just like we do
with x0-x7 in delouse_pt_regs() before passing syscall arguments to handlers.
So we cannot get rid of get/set_sigframe() converters in this case.

Current approach lets us keep user part looking more natural, and on
kernel side we don't add complexity because we reuse existing aarch32
or existing lp64 handlers, and don't invent something new.

> Do you have some objection to letting greg_t be a u64 on ilp32?

In binfmt_ilp32.c we
        #define compat_elf_gregset_t    elf_gregset_t
So in fact we use 64-bit gregset. Or I misunderstood you?

> Since you can’t tell LP64 and ILP32 syscalls apart by number, you need to add
> and wire up a new AUDIT_ARCH value for ILP32. syscall_get_arch() needs to work correctly.

Thanks for pointing to this. I'll append AUDIT_ARCH patch to this series.

Yury

^ permalink raw reply	[flat|nested] 104+ messages in thread

* Re: [PATCH v9 00/24] ILP32 for ARM64
@ 2019-01-07 20:43       ` Yuri Norov
  0 siblings, 0 replies; 104+ messages in thread
From: Yuri Norov @ 2019-01-07 20:43 UTC (permalink / raw)
  To: Andy Lutomirski
  Cc: linux-doc, Szabolcs Nagy, Catalin Marinas, Heiko Carstens,
	Philipp Tomsich, Joseph Myers, linux-arch, Steve Ellcey,
	yury.norov, Prasun Kapoor, Andreas Schwab, Alexander Graf,
	Geert Uytterhoeven, Bamvor Zhangjian, Dave Martin, Adam Borowski,
	Manuel Montezelo, James Hogan, Chris Metcalf, Arnd Bergmann,
	Andrew Pinski, Lin Yongting, Alexey Klimov, Mark Brown,
	linux-arm-kernel, Maxim Kuvyrkov, Florian Weimer, linux-api,
	Nathan_Lynch, linux-kernel, James Morse, Ramana Radhakrishnan,
	Martin Schwidefsky, David S . Miller, Christoph Muellner

On Mon, Jan 07, 2019 at 09:48:44AM -0800, Andy Lutomirski wrote:
> 
> 
> > On Jan 7, 2019, at 7:50 AM, Yuri Norov <ynorov@marvell.com> wrote:
> > 
> > Hi all,
> > 
> >> On Wed, May 16, 2018 at 11:18:45AM +0300, Yury Norov wrote:
> >> This series enables AARCH64 with ILP32 mode.
> >> 
> >> As supporting work, it introduces ARCH_32BIT_OFF_T configuration
> >> option that is enabled for existing 32-bit architectures but disabled
> >> for new arches (so 64-bit off_t userspace type is used by new userspace).
> >> Also it deprecates getrlimit and setrlimit syscalls prior to prlimit64.
> >> 
> >> Based on kernel v4.16. Tested with LTP, glibc testsuite, trinity, lmbench,
> >> CPUSpec.
> >> 
> >> This series on github: 
> >> https://github.com/norov/linux/tree/ilp32-4.16
> >> Linaro toolchain:
> >> http://snapshots.linaro.org/components/toolchain/binaries/7.3-2018.04-rc1/aarch64-linux-gnu_ilp32/
> >> Debian repo:
> >> http://people.linaro.org/~wookey/ilp32/
> >> OpenSUSE repo:
> >> https://build.opensuse.org/project/show/devel:ARM:Factory:Contrib:ILP32
> >> 
> >> Changes:
> >> v3: https://lkml.org/lkml/2014/9/3/704
> >> v4: https://lkml.org/lkml/2015/4/13/691
> >> v5: https://lkml.org/lkml/2015/9/29/911
> >> v6: https://lkml.org/lkml/2016/5/23/661
> >> v7: https://lkml.org/lkml/2017/1/9/213
> >> v8: https://lkml.org/lkml/2017/6/19/624
> >> v9: - rebased on top of v4.16;
> >>    - signal subsystem reworked to avoid code duplication, as requested
> >>      by Dave Martin (patches 18 and 20);
> >>    - new files introduced in series use SPDX notation for license;
> >>    - linux-api and linux-arch CCed as the series changes kernel ABI;
> >>    - checkpatch and other minor fixes.
> >>    - Zhou Chengming's reported-by for patch 2 and signed-off-by for
> >>      patch 21 removed because his email became invalid. Zhou, please
> >>      share your new email.
> > 
> > This is 4.20-based version.
> > https://github.com/norov/linux/tree/ilp32-4.20
> > 
> > There's no important changes comparing to 4.19, but I would like to remind
> > that this series contains some generic arch patches that ACKed, but still
> > not upstreamed:
> > Yury Norov      asm-generic: Drop getrlimit and setrlimit syscalls from default list
> > Yury Norov      32-bit userspace ABI: introduce ARCH_32BIT_OFF_T config option
> > Yury Norov      compat ABI: use non-compat openat and open_by_handle_at variants
> > James Morse     ptrace: Add compat PTRACE_{G,S}ETSIGMASK handlers
> > Dave Martin     arm64: signal: Make parse_user_sigframe() independent of rt_sigframe layout
> > 
> > Please also notice that my email address is changed, from now it's
> > ynorov@marvell.com
> > 
> 
> Having spent some time hating x32 lately, here is a cursory review:

I followed the recent discussion on x32 drop, but I don't track the story
from the beginning. Can you summarize your complains here (or maybe in
patch for Documentation)? It will be good for ilp32 because we will check
the series against all possible problems, and it will be good for history
because future compat architectures developers will be aware.

On your following questions, I'll try answer according to my understanding.
If it's wrong or incomplete, I kindly ask others fix me.

> You say “ILP32 has context-related structures different from both aarch32 and
> aarch64/lp64.”  Why?  Why not just use the lp64 context structure?

Because the alternative is nothing better than how we do now. We can make
rt_sigframe for ilp32 look exactly like lp64. But on user side we will
have to add pads therefore. On the kernel side, before passing rt_sigframe
to kernel, we will have to make sure that pads are zeroed, just like we do
with x0-x7 in delouse_pt_regs() before passing syscall arguments to handlers.
So we cannot get rid of get/set_sigframe() converters in this case.

Current approach lets us keep user part looking more natural, and on
kernel side we don't add complexity because we reuse existing aarch32
or existing lp64 handlers, and don't invent something new.

> Do you have some objection to letting greg_t be a u64 on ilp32?

In binfmt_ilp32.c we
        #define compat_elf_gregset_t    elf_gregset_t
So in fact we use 64-bit gregset. Or I misunderstood you?

> Since you can’t tell LP64 and ILP32 syscalls apart by number, you need to add
> and wire up a new AUDIT_ARCH value for ILP32. syscall_get_arch() needs to work correctly.

Thanks for pointing to this. I'll append AUDIT_ARCH patch to this series.

Yury
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply	[flat|nested] 104+ messages in thread

* Re: [PATCH v9 00/24] ILP32 for ARM64
  2018-05-16  8:18 ` Yury Norov
  (?)
  (?)
@ 2019-01-07 15:50   ` Yuri Norov
  -1 siblings, 0 replies; 104+ messages in thread
From: Yuri Norov @ 2019-01-07 15:50 UTC (permalink / raw)
  To: Yuri Norov
  Cc: Catalin Marinas, Arnd Bergmann, linux-arm-kernel, linux-kernel,
	linux-doc, linux-arch, linux-api, Adam Borowski, Alexander Graf,
	Alexey Klimov, Andreas Schwab, Andrew Pinski, Bamvor Zhangjian,
	Chris Metcalf, Christoph Muellner, Dave Martin, David S . Miller,
	Florian Weimer, Geert Uytterhoeven, Heiko Carstens, James Hogan,
	James Morse, Joseph Myers, Lin Yongting, Manuel Montezelo,
	Mark Brown, Martin Schwidefsky, Maxim Kuvyrkov, Nathan_Lynch,
	Philipp Tomsich, Prasun Kapoor, Ramana Radhakrishnan,
	Steve Ellcey, Szabolcs Nagy, yury.norov

Hi all,

On Wed, May 16, 2018 at 11:18:45AM +0300, Yury Norov wrote:
> This series enables AARCH64 with ILP32 mode.
> 
> As supporting work, it introduces ARCH_32BIT_OFF_T configuration
> option that is enabled for existing 32-bit architectures but disabled
> for new arches (so 64-bit off_t userspace type is used by new userspace).
> Also it deprecates getrlimit and setrlimit syscalls prior to prlimit64.
> 
> Based on kernel v4.16. Tested with LTP, glibc testsuite, trinity, lmbench,
> CPUSpec.
> 
> This series on github: 
> https://github.com/norov/linux/tree/ilp32-4.16
> Linaro toolchain:
> http://snapshots.linaro.org/components/toolchain/binaries/7.3-2018.04-rc1/aarch64-linux-gnu_ilp32/
> Debian repo:
> http://people.linaro.org/~wookey/ilp32/
> OpenSUSE repo:
> https://build.opensuse.org/project/show/devel:ARM:Factory:Contrib:ILP32
> 
> Changes:
> v3: https://lkml.org/lkml/2014/9/3/704
> v4: https://lkml.org/lkml/2015/4/13/691
> v5: https://lkml.org/lkml/2015/9/29/911
> v6: https://lkml.org/lkml/2016/5/23/661
> v7: https://lkml.org/lkml/2017/1/9/213
> v8: https://lkml.org/lkml/2017/6/19/624
> v9: - rebased on top of v4.16;
>     - signal subsystem reworked to avoid code duplication, as requested
>       by Dave Martin (patches 18 and 20);
>     - new files introduced in series use SPDX notation for license;
>     - linux-api and linux-arch CCed as the series changes kernel ABI;
>     - checkpatch and other minor fixes.
>     - Zhou Chengming's reported-by for patch 2 and signed-off-by for
>       patch 21 removed because his email became invalid. Zhou, please
>       share your new email.

This is 4.20-based version.
https://github.com/norov/linux/tree/ilp32-4.20

There's no important changes comparing to 4.19, but I would like to remind
that this series contains some generic arch patches that ACKed, but still
not upstreamed:
Yury Norov      asm-generic: Drop getrlimit and setrlimit syscalls from default list
Yury Norov      32-bit userspace ABI: introduce ARCH_32BIT_OFF_T config option
Yury Norov      compat ABI: use non-compat openat and open_by_handle_at variants
James Morse     ptrace: Add compat PTRACE_{G,S}ETSIGMASK handlers
Dave Martin     arm64: signal: Make parse_user_sigframe() independent of rt_sigframe layout

Please also notice that my email address is changed, from now it's
ynorov@marvell.com

Yury

^ permalink raw reply	[flat|nested] 104+ messages in thread

* Re: [PATCH v9 00/24] ILP32 for ARM64
@ 2019-01-07 15:50   ` Yuri Norov
  0 siblings, 0 replies; 104+ messages in thread
From: Yuri Norov @ 2019-01-07 15:50 UTC (permalink / raw)
  To: Yuri Norov
  Cc: linux-doc, Szabolcs Nagy, Catalin Marinas, Heiko Carstens,
	Philipp Tomsich, Joseph Myers, linux-arch, Steve Ellcey,
	yury.norov, Prasun Kapoor, Andreas Schwab, Alexander Graf,
	Geert Uytterhoeven, Bamvor Zhangjian, Dave Martin, Adam Borowski,
	Manuel Montezelo, James Hogan, Chris Metcalf, Arnd Bergmann,
	Andrew Pinski

Hi all,

On Wed, May 16, 2018 at 11:18:45AM +0300, Yury Norov wrote:
> This series enables AARCH64 with ILP32 mode.
> 
> As supporting work, it introduces ARCH_32BIT_OFF_T configuration
> option that is enabled for existing 32-bit architectures but disabled
> for new arches (so 64-bit off_t userspace type is used by new userspace).
> Also it deprecates getrlimit and setrlimit syscalls prior to prlimit64.
> 
> Based on kernel v4.16. Tested with LTP, glibc testsuite, trinity, lmbench,
> CPUSpec.
> 
> This series on github: 
> https://github.com/norov/linux/tree/ilp32-4.16
> Linaro toolchain:
> http://snapshots.linaro.org/components/toolchain/binaries/7.3-2018.04-rc1/aarch64-linux-gnu_ilp32/
> Debian repo:
> http://people.linaro.org/~wookey/ilp32/
> OpenSUSE repo:
> https://build.opensuse.org/project/show/devel:ARM:Factory:Contrib:ILP32
> 
> Changes:
> v3: https://lkml.org/lkml/2014/9/3/704
> v4: https://lkml.org/lkml/2015/4/13/691
> v5: https://lkml.org/lkml/2015/9/29/911
> v6: https://lkml.org/lkml/2016/5/23/661
> v7: https://lkml.org/lkml/2017/1/9/213
> v8: https://lkml.org/lkml/2017/6/19/624
> v9: - rebased on top of v4.16;
>     - signal subsystem reworked to avoid code duplication, as requested
>       by Dave Martin (patches 18 and 20);
>     - new files introduced in series use SPDX notation for license;
>     - linux-api and linux-arch CCed as the series changes kernel ABI;
>     - checkpatch and other minor fixes.
>     - Zhou Chengming's reported-by for patch 2 and signed-off-by for
>       patch 21 removed because his email became invalid. Zhou, please
>       share your new email.

This is 4.20-based version.
https://github.com/norov/linux/tree/ilp32-4.20

There's no important changes comparing to 4.19, but I would like to remind
that this series contains some generic arch patches that ACKed, but still
not upstreamed:
Yury Norov      asm-generic: Drop getrlimit and setrlimit syscalls from default list
Yury Norov      32-bit userspace ABI: introduce ARCH_32BIT_OFF_T config option
Yury Norov      compat ABI: use non-compat openat and open_by_handle_at variants
James Morse     ptrace: Add compat PTRACE_{G,S}ETSIGMASK handlers
Dave Martin     arm64: signal: Make parse_user_sigframe() independent of rt_sigframe layout

Please also notice that my email address is changed, from now it's
ynorov@marvell.com

Yury

^ permalink raw reply	[flat|nested] 104+ messages in thread

* Re: [PATCH v9 00/24] ILP32 for ARM64
@ 2019-01-07 15:50   ` Yuri Norov
  0 siblings, 0 replies; 104+ messages in thread
From: Yuri Norov @ 2019-01-07 15:50 UTC (permalink / raw)
  To: Yuri Norov
  Cc: Catalin Marinas, Arnd Bergmann, linux-arm-kernel, linux-kernel,
	linux-doc, linux-arch, linux-api, Adam Borowski, Alexander Graf,
	Alexey Klimov, Andreas Schwab, Andrew Pinski, Bamvor Zhangjian,
	Chris Metcalf, Christoph Muellner, Dave Martin, David S . Miller,
	Florian Weimer, Geert Uytterhoeven, Heiko Carstens, James Hogan,
	James Morse, Joseph Myers, Lin Yongting, Manuel Montezelo,
	Mark Brown, Martin Schwidefsky, Maxim Kuvyrkov, Nathan_Lynch,
	Philipp Tomsich, Prasun Kapoor, Ramana Radhakrishnan,
	Steve Ellcey, Szabolcs Nagy, yury.norov

Hi all,

On Wed, May 16, 2018 at 11:18:45AM +0300, Yury Norov wrote:
> This series enables AARCH64 with ILP32 mode.
> 
> As supporting work, it introduces ARCH_32BIT_OFF_T configuration
> option that is enabled for existing 32-bit architectures but disabled
> for new arches (so 64-bit off_t userspace type is used by new userspace).
> Also it deprecates getrlimit and setrlimit syscalls prior to prlimit64.
> 
> Based on kernel v4.16. Tested with LTP, glibc testsuite, trinity, lmbench,
> CPUSpec.
> 
> This series on github: 
> https://github.com/norov/linux/tree/ilp32-4.16
> Linaro toolchain:
> http://snapshots.linaro.org/components/toolchain/binaries/7.3-2018.04-rc1/aarch64-linux-gnu_ilp32/
> Debian repo:
> http://people.linaro.org/~wookey/ilp32/
> OpenSUSE repo:
> https://build.opensuse.org/project/show/devel:ARM:Factory:Contrib:ILP32
> 
> Changes:
> v3: https://lkml.org/lkml/2014/9/3/704
> v4: https://lkml.org/lkml/2015/4/13/691
> v5: https://lkml.org/lkml/2015/9/29/911
> v6: https://lkml.org/lkml/2016/5/23/661
> v7: https://lkml.org/lkml/2017/1/9/213
> v8: https://lkml.org/lkml/2017/6/19/624
> v9: - rebased on top of v4.16;
>     - signal subsystem reworked to avoid code duplication, as requested
>       by Dave Martin (patches 18 and 20);
>     - new files introduced in series use SPDX notation for license;
>     - linux-api and linux-arch CCed as the series changes kernel ABI;
>     - checkpatch and other minor fixes.
>     - Zhou Chengming's reported-by for patch 2 and signed-off-by for
>       patch 21 removed because his email became invalid. Zhou, please
>       share your new email.

This is 4.20-based version.
https://github.com/norov/linux/tree/ilp32-4.20

There's no important changes comparing to 4.19, but I would like to remind
that this series contains some generic arch patches that ACKed, but still
not upstreamed:
Yury Norov      asm-generic: Drop getrlimit and setrlimit syscalls from default list
Yury Norov      32-bit userspace ABI: introduce ARCH_32BIT_OFF_T config option
Yury Norov      compat ABI: use non-compat openat and open_by_handle_at variants
James Morse     ptrace: Add compat PTRACE_{G,S}ETSIGMASK handlers
Dave Martin     arm64: signal: Make parse_user_sigframe() independent of rt_sigframe layout

Please also notice that my email address is changed, from now it's
ynorov@marvell.com

Yury

^ permalink raw reply	[flat|nested] 104+ messages in thread

* Re: [PATCH v9 00/24] ILP32 for ARM64
@ 2019-01-07 15:50   ` Yuri Norov
  0 siblings, 0 replies; 104+ messages in thread
From: Yuri Norov @ 2019-01-07 15:50 UTC (permalink / raw)
  To: Yuri Norov
  Cc: linux-doc, Szabolcs Nagy, Catalin Marinas, Heiko Carstens,
	Philipp Tomsich, Joseph Myers, linux-arch, Steve Ellcey,
	yury.norov, Prasun Kapoor, Andreas Schwab, Alexander Graf,
	Geert Uytterhoeven, Bamvor Zhangjian, Dave Martin, Adam Borowski,
	Manuel Montezelo, James Hogan, Chris Metcalf, Arnd Bergmann,
	Andrew Pinski, Lin Yongting, Alexey Klimov, Mark Brown,
	linux-arm-kernel, Maxim Kuvyrkov, Florian Weimer, linux-api,
	Nathan_Lynch, linux-kernel, James Morse, Ramana Radhakrishnan,
	Martin Schwidefsky, David S . Miller, Christoph Muellner

Hi all,

On Wed, May 16, 2018 at 11:18:45AM +0300, Yury Norov wrote:
> This series enables AARCH64 with ILP32 mode.
> 
> As supporting work, it introduces ARCH_32BIT_OFF_T configuration
> option that is enabled for existing 32-bit architectures but disabled
> for new arches (so 64-bit off_t userspace type is used by new userspace).
> Also it deprecates getrlimit and setrlimit syscalls prior to prlimit64.
> 
> Based on kernel v4.16. Tested with LTP, glibc testsuite, trinity, lmbench,
> CPUSpec.
> 
> This series on github: 
> https://github.com/norov/linux/tree/ilp32-4.16
> Linaro toolchain:
> http://snapshots.linaro.org/components/toolchain/binaries/7.3-2018.04-rc1/aarch64-linux-gnu_ilp32/
> Debian repo:
> http://people.linaro.org/~wookey/ilp32/
> OpenSUSE repo:
> https://build.opensuse.org/project/show/devel:ARM:Factory:Contrib:ILP32
> 
> Changes:
> v3: https://lkml.org/lkml/2014/9/3/704
> v4: https://lkml.org/lkml/2015/4/13/691
> v5: https://lkml.org/lkml/2015/9/29/911
> v6: https://lkml.org/lkml/2016/5/23/661
> v7: https://lkml.org/lkml/2017/1/9/213
> v8: https://lkml.org/lkml/2017/6/19/624
> v9: - rebased on top of v4.16;
>     - signal subsystem reworked to avoid code duplication, as requested
>       by Dave Martin (patches 18 and 20);
>     - new files introduced in series use SPDX notation for license;
>     - linux-api and linux-arch CCed as the series changes kernel ABI;
>     - checkpatch and other minor fixes.
>     - Zhou Chengming's reported-by for patch 2 and signed-off-by for
>       patch 21 removed because his email became invalid. Zhou, please
>       share your new email.

This is 4.20-based version.
https://github.com/norov/linux/tree/ilp32-4.20

There's no important changes comparing to 4.19, but I would like to remind
that this series contains some generic arch patches that ACKed, but still
not upstreamed:
Yury Norov      asm-generic: Drop getrlimit and setrlimit syscalls from default list
Yury Norov      32-bit userspace ABI: introduce ARCH_32BIT_OFF_T config option
Yury Norov      compat ABI: use non-compat openat and open_by_handle_at variants
James Morse     ptrace: Add compat PTRACE_{G,S}ETSIGMASK handlers
Dave Martin     arm64: signal: Make parse_user_sigframe() independent of rt_sigframe layout

Please also notice that my email address is changed, from now it's
ynorov@marvell.com

Yury

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply	[flat|nested] 104+ messages in thread

* Re: [PATCH v9 00/24] ILP32 for ARM64
  2018-05-16  8:18 ` Yury Norov
  (?)
  (?)
@ 2018-11-19 21:29   ` Yury Norov
  -1 siblings, 0 replies; 104+ messages in thread
From: Yury Norov @ 2018-11-19 21:29 UTC (permalink / raw)
  To: Catalin Marinas, Arnd Bergmann, linux-arm-kernel, linux-kernel,
	linux-doc, linux-arch, linux-api
  Cc: Adam Borowski, Alexander Graf, Alexey Klimov, Andreas Schwab,
	Andrew Pinski, Bamvor Zhangjian, Chris Metcalf,
	Christoph Muellner, Dave Martin, David S . Miller,
	Florian Weimer, Geert Uytterhoeven, Heiko Carstens, James Hogan,
	James Morse, Joseph Myers, Lin Yongting, Manuel Montezelo,
	Mark Brown, Martin Schwidefsky, Maxim Kuvyrkov, Nathan_Lynch,
	Philipp Tomsich, Kapoor, Prasun, Ramana Radhakrishnan, Ellcey,
	Steve, Szabolcs Nagy

Hi all,

On Wed, May 16, 2018 at 11:18:45AM +0300, Yury Norov wrote:
> This series enables AARCH64 with ILP32 mode.
> 
> As supporting work, it introduces ARCH_32BIT_OFF_T configuration
> option that is enabled for existing 32-bit architectures but disabled
> for new arches (so 64-bit off_t userspace type is used by new userspace).
> Also it deprecates getrlimit and setrlimit syscalls prior to prlimit64.
> 
> Based on kernel v4.16. Tested with LTP, glibc testsuite, trinity, lmbench,
> CPUSpec.
> 
> This series on github: 
> https://github.com/norov/linux/tree/ilp32-4.16
> Linaro toolchain:
> http://snapshots.linaro.org/components/toolchain/binaries/7.3-2018.04-rc1/aarch64-linux-gnu_ilp32/
> Debian repo:
> http://people.linaro.org/~wookey/ilp32/
> OpenSUSE repo:
> https://build.opensuse.org/project/show/devel:ARM:Factory:Contrib:ILP32
> 
> Changes:
> v3: https://lkml.org/lkml/2014/9/3/704
> v4: https://lkml.org/lkml/2015/4/13/691
> v5: https://lkml.org/lkml/2015/9/29/911
> v6: https://lkml.org/lkml/2016/5/23/661
> v7: https://lkml.org/lkml/2017/1/9/213
> v8: https://lkml.org/lkml/2017/6/19/624
> v9: - rebased on top of v4.16;
>     - signal subsystem reworked to avoid code duplication, as requested
>       by Dave Martin (patches 18 and 20);
>     - new files introduced in series use SPDX notation for license;
>     - linux-api and linux-arch CCed as the series changes kernel ABI;
>     - checkpatch and other minor fixes.
>     - Zhou Chengming's reported-by for patch 2 and signed-off-by for
>       patch 21 removed because his email became invalid. Zhou, please
>       share your new email.

This is the 4.19-based update:
https://github.com/norov/linux/tree/ilp32-4.19

Syscall machinery is rewritten in C in mainline kernel, ILP32 is aligned
with it. The following patches are mostly affected:

arm64: ilp32: introduce ilp32-specific sigframe and ucontext
arm64: signal32: move ilp32 and aarch32 common code to separated file
arm64: signal: share lp64 signal structures and routines to ilp32
arm64: ilp32: introduce syscall table for ILP32
arm64: ilp32: share aarch32 syscall handlers

4.18 branch from Catalin is here:
https://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux.git/log/?h=staging/ilp32-4.18

Yury

^ permalink raw reply	[flat|nested] 104+ messages in thread

* Re: [PATCH v9 00/24] ILP32 for ARM64
@ 2018-11-19 21:29   ` Yury Norov
  0 siblings, 0 replies; 104+ messages in thread
From: Yury Norov @ 2018-11-19 21:29 UTC (permalink / raw)
  To: Catalin Marinas, Arnd Bergmann, linux-arm-kernel, linux-kernel,
	linux-doc, linux-arch, linux-api
  Cc: Adam Borowski, Alexander Graf, Alexey Klimov, Andreas Schwab,
	Andrew Pinski, Bamvor Zhangjian, Chris Metcalf,
	Christoph Muellner, Dave Martin, David S . Miller,
	Florian Weimer, Geert Uytterhoeven, Heiko Carstens, James Hogan,
	James Morse, Joseph Myers, Lin Yongting, Manuel Montezelo,
	Mark Brown

Hi all,

On Wed, May 16, 2018 at 11:18:45AM +0300, Yury Norov wrote:
> This series enables AARCH64 with ILP32 mode.
> 
> As supporting work, it introduces ARCH_32BIT_OFF_T configuration
> option that is enabled for existing 32-bit architectures but disabled
> for new arches (so 64-bit off_t userspace type is used by new userspace).
> Also it deprecates getrlimit and setrlimit syscalls prior to prlimit64.
> 
> Based on kernel v4.16. Tested with LTP, glibc testsuite, trinity, lmbench,
> CPUSpec.
> 
> This series on github: 
> https://github.com/norov/linux/tree/ilp32-4.16
> Linaro toolchain:
> http://snapshots.linaro.org/components/toolchain/binaries/7.3-2018.04-rc1/aarch64-linux-gnu_ilp32/
> Debian repo:
> http://people.linaro.org/~wookey/ilp32/
> OpenSUSE repo:
> https://build.opensuse.org/project/show/devel:ARM:Factory:Contrib:ILP32
> 
> Changes:
> v3: https://lkml.org/lkml/2014/9/3/704
> v4: https://lkml.org/lkml/2015/4/13/691
> v5: https://lkml.org/lkml/2015/9/29/911
> v6: https://lkml.org/lkml/2016/5/23/661
> v7: https://lkml.org/lkml/2017/1/9/213
> v8: https://lkml.org/lkml/2017/6/19/624
> v9: - rebased on top of v4.16;
>     - signal subsystem reworked to avoid code duplication, as requested
>       by Dave Martin (patches 18 and 20);
>     - new files introduced in series use SPDX notation for license;
>     - linux-api and linux-arch CCed as the series changes kernel ABI;
>     - checkpatch and other minor fixes.
>     - Zhou Chengming's reported-by for patch 2 and signed-off-by for
>       patch 21 removed because his email became invalid. Zhou, please
>       share your new email.

This is the 4.19-based update:
https://github.com/norov/linux/tree/ilp32-4.19

Syscall machinery is rewritten in C in mainline kernel, ILP32 is aligned
with it. The following patches are mostly affected:

arm64: ilp32: introduce ilp32-specific sigframe and ucontext
arm64: signal32: move ilp32 and aarch32 common code to separated file
arm64: signal: share lp64 signal structures and routines to ilp32
arm64: ilp32: introduce syscall table for ILP32
arm64: ilp32: share aarch32 syscall handlers

4.18 branch from Catalin is here:
https://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux.git/log/?h=staging/ilp32-4.18

Yury

^ permalink raw reply	[flat|nested] 104+ messages in thread

* Re: [PATCH v9 00/24] ILP32 for ARM64
@ 2018-11-19 21:29   ` Yury Norov
  0 siblings, 0 replies; 104+ messages in thread
From: Yury Norov @ 2018-11-19 21:29 UTC (permalink / raw)
  To: Catalin Marinas, Arnd Bergmann, linux-arm-kernel, linux-kernel,
	linux-doc, linux-arch, linux-api
  Cc: Adam Borowski, Alexander Graf, Alexey Klimov, Andreas Schwab,
	Andrew Pinski, Bamvor Zhangjian, Chris Metcalf,
	Christoph Muellner, Dave Martin, David S . Miller,
	Florian Weimer, Geert Uytterhoeven, Heiko Carstens, James Hogan,
	James Morse, Joseph Myers, Lin Yongting, Manuel Montezelo,
	Mark Brown, Martin Schwidefsky, Maxim Kuvyrkov, Nathan_Lynch,
	Philipp Tomsich, Kapoor, Prasun, Ramana Radhakrishnan, Ellcey,
	Steve, Szabolcs Nagy

Hi all,

On Wed, May 16, 2018 at 11:18:45AM +0300, Yury Norov wrote:
> This series enables AARCH64 with ILP32 mode.
> 
> As supporting work, it introduces ARCH_32BIT_OFF_T configuration
> option that is enabled for existing 32-bit architectures but disabled
> for new arches (so 64-bit off_t userspace type is used by new userspace).
> Also it deprecates getrlimit and setrlimit syscalls prior to prlimit64.
> 
> Based on kernel v4.16. Tested with LTP, glibc testsuite, trinity, lmbench,
> CPUSpec.
> 
> This series on github: 
> https://github.com/norov/linux/tree/ilp32-4.16
> Linaro toolchain:
> http://snapshots.linaro.org/components/toolchain/binaries/7.3-2018.04-rc1/aarch64-linux-gnu_ilp32/
> Debian repo:
> http://people.linaro.org/~wookey/ilp32/
> OpenSUSE repo:
> https://build.opensuse.org/project/show/devel:ARM:Factory:Contrib:ILP32
> 
> Changes:
> v3: https://lkml.org/lkml/2014/9/3/704
> v4: https://lkml.org/lkml/2015/4/13/691
> v5: https://lkml.org/lkml/2015/9/29/911
> v6: https://lkml.org/lkml/2016/5/23/661
> v7: https://lkml.org/lkml/2017/1/9/213
> v8: https://lkml.org/lkml/2017/6/19/624
> v9: - rebased on top of v4.16;
>     - signal subsystem reworked to avoid code duplication, as requested
>       by Dave Martin (patches 18 and 20);
>     - new files introduced in series use SPDX notation for license;
>     - linux-api and linux-arch CCed as the series changes kernel ABI;
>     - checkpatch and other minor fixes.
>     - Zhou Chengming's reported-by for patch 2 and signed-off-by for
>       patch 21 removed because his email became invalid. Zhou, please
>       share your new email.

This is the 4.19-based update:
https://github.com/norov/linux/tree/ilp32-4.19

Syscall machinery is rewritten in C in mainline kernel, ILP32 is aligned
with it. The following patches are mostly affected:

arm64: ilp32: introduce ilp32-specific sigframe and ucontext
arm64: signal32: move ilp32 and aarch32 common code to separated file
arm64: signal: share lp64 signal structures and routines to ilp32
arm64: ilp32: introduce syscall table for ILP32
arm64: ilp32: share aarch32 syscall handlers

4.18 branch from Catalin is here:
https://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux.git/log/?h=staging/ilp32-4.18

Yury

^ permalink raw reply	[flat|nested] 104+ messages in thread

* [PATCH v9 00/24] ILP32 for ARM64
@ 2018-11-19 21:29   ` Yury Norov
  0 siblings, 0 replies; 104+ messages in thread
From: Yury Norov @ 2018-11-19 21:29 UTC (permalink / raw)
  To: linux-arm-kernel

Hi all,

On Wed, May 16, 2018 at 11:18:45AM +0300, Yury Norov wrote:
> This series enables AARCH64 with ILP32 mode.
> 
> As supporting work, it introduces ARCH_32BIT_OFF_T configuration
> option that is enabled for existing 32-bit architectures but disabled
> for new arches (so 64-bit off_t userspace type is used by new userspace).
> Also it deprecates getrlimit and setrlimit syscalls prior to prlimit64.
> 
> Based on kernel v4.16. Tested with LTP, glibc testsuite, trinity, lmbench,
> CPUSpec.
> 
> This series on github: 
> https://github.com/norov/linux/tree/ilp32-4.16
> Linaro toolchain:
> http://snapshots.linaro.org/components/toolchain/binaries/7.3-2018.04-rc1/aarch64-linux-gnu_ilp32/
> Debian repo:
> http://people.linaro.org/~wookey/ilp32/
> OpenSUSE repo:
> https://build.opensuse.org/project/show/devel:ARM:Factory:Contrib:ILP32
> 
> Changes:
> v3: https://lkml.org/lkml/2014/9/3/704
> v4: https://lkml.org/lkml/2015/4/13/691
> v5: https://lkml.org/lkml/2015/9/29/911
> v6: https://lkml.org/lkml/2016/5/23/661
> v7: https://lkml.org/lkml/2017/1/9/213
> v8: https://lkml.org/lkml/2017/6/19/624
> v9: - rebased on top of v4.16;
>     - signal subsystem reworked to avoid code duplication, as requested
>       by Dave Martin (patches 18 and 20);
>     - new files introduced in series use SPDX notation for license;
>     - linux-api and linux-arch CCed as the series changes kernel ABI;
>     - checkpatch and other minor fixes.
>     - Zhou Chengming's reported-by for patch 2 and signed-off-by for
>       patch 21 removed because his email became invalid. Zhou, please
>       share your new email.

This is the 4.19-based update:
https://github.com/norov/linux/tree/ilp32-4.19

Syscall machinery is rewritten in C in mainline kernel, ILP32 is aligned
with it. The following patches are mostly affected:

arm64: ilp32: introduce ilp32-specific sigframe and ucontext
arm64: signal32: move ilp32 and aarch32 common code to separated file
arm64: signal: share lp64 signal structures and routines to ilp32
arm64: ilp32: introduce syscall table for ILP32
arm64: ilp32: share aarch32 syscall handlers

4.18 branch from Catalin is here:
https://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux.git/log/?h=staging/ilp32-4.18

Yury

^ permalink raw reply	[flat|nested] 104+ messages in thread

* [PATCH v9 00/24] ILP32 for ARM64
  2018-11-15 20:27           ` Yury Norov
@ 2018-11-19  9:57             ` Andreas Schwab
  0 siblings, 0 replies; 104+ messages in thread
From: Andreas Schwab @ 2018-11-19  9:57 UTC (permalink / raw)
  To: linux-arm-kernel

On Nov 15 2018, Yury Norov <ynorov@caviumnetworks.com> wrote:

> Next week, I'll finish all my testing and make a more 'official' announcement.
> But I think that everything is generally fine, so please take an early
> look, if you're interested in.

I has been tested successfully in OBS.

Thanks, Andreas.

-- 
Andreas Schwab, SUSE Labs, schwab at suse.de
GPG Key fingerprint = 0196 BAD8 1CE9 1970 F4BE  1748 E4D4 88E3 0EEA B9D7
"And now for something completely different."

^ permalink raw reply	[flat|nested] 104+ messages in thread

* [PATCH v9 00/24] ILP32 for ARM64
  2018-11-15  8:54         ` Andreas Schwab
@ 2018-11-15 20:27           ` Yury Norov
  2018-11-19  9:57             ` Andreas Schwab
  0 siblings, 1 reply; 104+ messages in thread
From: Yury Norov @ 2018-11-15 20:27 UTC (permalink / raw)
  To: linux-arm-kernel

On Thu, Nov 15, 2018 at 09:54:44AM +0100, Andreas Schwab wrote:
> On Nov 15 2018, Catalin Marinas <catalin.marinas@arm.com> wrote:
> 
> > Hopefully the changes between 4.18 and 4.19 are smaller than .17->.18.
> 
> It's the other way round, unfortunately.

Hi Catalin, Andreas,

This is the 4.19-based series with fixes to regressions I mentioned above: 
https://github.com/norov/linux/commits/ilp32-4.19.2

Syscall machinery is rewritten in C in mainline kernel, so I aligned ILP32
with it. I think it's worth to revisit all the series with careful review, but
the following patches look the most affected:

73eb215286f0 arm64: ilp32: introduce ilp32-specific sigframe and ucontext
5a8f18457b58 arm64: signal32: move ilp32 and aarch32 common code to separated file
561dd666d5b4 arm64: signal: share lp64 signal structures and routines to ilp32
cd7dc1d3377a arm64: ilp32: introduce syscall table for ILP32
68ff08f76bf0 arm64: ilp32: share aarch32 syscall handlers

Next week, I'll finish all my testing and make a more 'official' announcement.
But I think that everything is generally fine, so please take an early
look, if you're interested in.

Thanks,
Yury

^ permalink raw reply	[flat|nested] 104+ messages in thread

* [PATCH v9 00/24] ILP32 for ARM64
  2018-11-15  0:51       ` Catalin Marinas
@ 2018-11-15  8:54         ` Andreas Schwab
  2018-11-15 20:27           ` Yury Norov
  0 siblings, 1 reply; 104+ messages in thread
From: Andreas Schwab @ 2018-11-15  8:54 UTC (permalink / raw)
  To: linux-arm-kernel

On Nov 15 2018, Catalin Marinas <catalin.marinas@arm.com> wrote:

> Hopefully the changes between 4.18 and 4.19 are smaller than .17->.18.

It's the other way round, unfortunately.

Andreas.

-- 
Andreas Schwab, SUSE Labs, schwab at suse.de
GPG Key fingerprint = 0196 BAD8 1CE9 1970 F4BE  1748 E4D4 88E3 0EEA B9D7
"And now for something completely different."

^ permalink raw reply	[flat|nested] 104+ messages in thread

* [PATCH v9 00/24] ILP32 for ARM64
  2018-11-13 10:57     ` Yury Norov
@ 2018-11-15  0:51       ` Catalin Marinas
  2018-11-15  8:54         ` Andreas Schwab
  0 siblings, 1 reply; 104+ messages in thread
From: Catalin Marinas @ 2018-11-15  0:51 UTC (permalink / raw)
  To: linux-arm-kernel

On Tue, Nov 13, 2018 at 10:57:26AM +0000, Yury Norov wrote:
> On Tue, Nov 13, 2018 at 11:04:53AM +0100, Andreas Schwab wrote:
> > On Jul 24 2018, Yury Norov <ynorov@caviumnetworks.com> wrote:
> > 
> > > This is the update of the series based on 4.17 kernel
> > > https://github.com/norov/linux/tree/ilp32-4.17
> > 
> > Do you aleady have an update for 4.19?
> 
> I've started this work.
> 
> Comparing to 4.17, there are major changes in syscall handling -
> such routines are rewritten in C, and in signals. At now, basic tests
> work, but signal delivering causes illegal instruction abort.

If it helps, I have a 4.18 branch here:

https://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux.git/log/?h=staging/ilp32-4.18

Hopefully the changes between 4.18 and 4.19 are smaller than .17->.18.

-- 
Catalin

^ permalink raw reply	[flat|nested] 104+ messages in thread

* [PATCH v9 00/24] ILP32 for ARM64
  2018-11-13 10:04   ` Andreas Schwab
@ 2018-11-13 10:57     ` Yury Norov
  2018-11-15  0:51       ` Catalin Marinas
  0 siblings, 1 reply; 104+ messages in thread
From: Yury Norov @ 2018-11-13 10:57 UTC (permalink / raw)
  To: linux-arm-kernel

On Tue, Nov 13, 2018 at 11:04:53AM +0100, Andreas Schwab wrote:
> External Email
> 
> On Jul 24 2018, Yury Norov <ynorov@caviumnetworks.com> wrote:
> 
> > This is the update of the series based on 4.17 kernel
> > https://github.com/norov/linux/tree/ilp32-4.17
> 
> Do you aleady have an update for 4.19?

I've started this work.

Comparing to 4.17, there are major changes in syscall handling -
such routines are rewritten in C, and in signals. At now, basic tests
work, but signal delivering causes illegal instruction abort.

If you interested in work-in-progress, it's here:
https://github.com/norov/linux/tree/ilp32-4.19.1

I hope finish the rebase till the end of November. If you need it
earlier, please let me know.

Yury

^ permalink raw reply	[flat|nested] 104+ messages in thread

* [PATCH v9 00/24] ILP32 for ARM64
  2018-07-24 17:39   ` Yury Norov
                     ` (4 preceding siblings ...)
  (?)
@ 2018-11-13 10:04   ` Andreas Schwab
  2018-11-13 10:57     ` Yury Norov
  -1 siblings, 1 reply; 104+ messages in thread
From: Andreas Schwab @ 2018-11-13 10:04 UTC (permalink / raw)
  To: linux-arm-kernel

On Jul 24 2018, Yury Norov <ynorov@caviumnetworks.com> wrote:

> This is the update of the series based on 4.17 kernel
> https://github.com/norov/linux/tree/ilp32-4.17

Do you aleady have an update for 4.19?

Andreas.

-- 
Andreas Schwab, SUSE Labs, schwab at suse.de
GPG Key fingerprint = 0196 BAD8 1CE9 1970 F4BE  1748 E4D4 88E3 0EEA B9D7
"And now for something completely different."

^ permalink raw reply	[flat|nested] 104+ messages in thread

* Re: [PATCH v9 00/24] ILP32 for ARM64
  2018-10-14 19:49     ` Arnd Bergmann
  (?)
@ 2018-10-18 11:14       ` Catalin Marinas
  -1 siblings, 0 replies; 104+ messages in thread
From: Catalin Marinas @ 2018-10-18 11:14 UTC (permalink / raw)
  To: Arnd Bergmann
  Cc: Andy Lutomirski, open list:DOCUMENTATION, Szabolcs Nagy,
	Heiko Carstens, Yury Norov, Philipp Tomsich, Joseph Myers,
	linux-arch, Steve Ellcey, Prasun Kapoor, Andreas Schwab,
	Alexander Graf, Geert Uytterhoeven, Bamvor Zhangjian,
	Dave Martin, Adam Borowski, Manuel A. Fernandez Montecelo,
	James Hogan, Chris Metcalf, Andrew Pinski, Lin Yongting,
	Alexey Klimov, Mark Brown, Linux ARM, Maxim Kuvyrkov,
	Florian Weimer, Linux API, Nathan Lynch,
	Linux Kernel Mailing List, James Morse, Ramana Radhakrishnan,
	Martin Schwidefsky, David Miller, Christoph Muellner

On Sun, Oct 14, 2018 at 09:49:01PM +0200, Arnd Bergmann wrote:
> On Sat, Oct 13, 2018 at 9:36 PM Andy Lutomirski <luto@amacapital.net> wrote:
> >
> > On Wed, May 16, 2018 at 1:19 AM Yury Norov <ynorov@caviumnetworks.com> wrote:
> > >
> > > This series enables AARCH64 with ILP32 mode.
> > >
> > > As supporting work, it introduces ARCH_32BIT_OFF_T configuration
> > > option that is enabled for existing 32-bit architectures but disabled
> > > for new arches (so 64-bit off_t userspace type is used by new userspace).
> > > Also it deprecates getrlimit and setrlimit syscalls prior to prlimit64.
> >
> > Second, ILP32 user code is highly unlikely
> > to end up with the same struct layout as ILP64 code.  The latter seems
> > like it should be solved entirely in userspace by adding a way to
> > annotate a structure as being a kernel ABI structure and getting the
> > toolchain to lay it out as if it were ILP64 even though the target is
> > ILP32.
> 
> The syscall ABI could be almost completely abstracted in glibc, the
> main issue is ioctl and a couple of related interfaces that pass data
> structures (read() on /dev/input/*, mmap on /dev/snd/*
> or raw sockets, fcntl).

There is another case on struct siginfo which has some pointers and it
wouldn't look like an LP64 structure at all (and glibc doesn't normally
intercept the sighandler call to rewrite the structure). We could add
padding around void * members as the kernel zeros them, I don't recall
the kernel reading these pointers from user. Anyway, using something
that resembles compat_siginfo looked the simplest for ILP32.

-- 
Catalin

^ permalink raw reply	[flat|nested] 104+ messages in thread

* Re: [PATCH v9 00/24] ILP32 for ARM64
@ 2018-10-18 11:14       ` Catalin Marinas
  0 siblings, 0 replies; 104+ messages in thread
From: Catalin Marinas @ 2018-10-18 11:14 UTC (permalink / raw)
  To: Arnd Bergmann
  Cc: Andy Lutomirski, open list:DOCUMENTATION, Szabolcs Nagy,
	Heiko Carstens, Yury Norov, Philipp Tomsich, Joseph Myers,
	linux-arch, Steve Ellcey, Prasun Kapoor, Andreas Schwab,
	Alexander Graf, Geert Uytterhoeven, Bamvor Zhangjian,
	Dave Martin, Adam Borowski, Manuel A. Fernandez Montecelo,
	James Hogan

On Sun, Oct 14, 2018 at 09:49:01PM +0200, Arnd Bergmann wrote:
> On Sat, Oct 13, 2018 at 9:36 PM Andy Lutomirski <luto@amacapital.net> wrote:
> >
> > On Wed, May 16, 2018 at 1:19 AM Yury Norov <ynorov@caviumnetworks.com> wrote:
> > >
> > > This series enables AARCH64 with ILP32 mode.
> > >
> > > As supporting work, it introduces ARCH_32BIT_OFF_T configuration
> > > option that is enabled for existing 32-bit architectures but disabled
> > > for new arches (so 64-bit off_t userspace type is used by new userspace).
> > > Also it deprecates getrlimit and setrlimit syscalls prior to prlimit64.
> >
> > Second, ILP32 user code is highly unlikely
> > to end up with the same struct layout as ILP64 code.  The latter seems
> > like it should be solved entirely in userspace by adding a way to
> > annotate a structure as being a kernel ABI structure and getting the
> > toolchain to lay it out as if it were ILP64 even though the target is
> > ILP32.
> 
> The syscall ABI could be almost completely abstracted in glibc, the
> main issue is ioctl and a couple of related interfaces that pass data
> structures (read() on /dev/input/*, mmap on /dev/snd/*
> or raw sockets, fcntl).

There is another case on struct siginfo which has some pointers and it
wouldn't look like an LP64 structure at all (and glibc doesn't normally
intercept the sighandler call to rewrite the structure). We could add
padding around void * members as the kernel zeros them, I don't recall
the kernel reading these pointers from user. Anyway, using something
that resembles compat_siginfo looked the simplest for ILP32.

-- 
Catalin

^ permalink raw reply	[flat|nested] 104+ messages in thread

* [PATCH v9 00/24] ILP32 for ARM64
@ 2018-10-18 11:14       ` Catalin Marinas
  0 siblings, 0 replies; 104+ messages in thread
From: Catalin Marinas @ 2018-10-18 11:14 UTC (permalink / raw)
  To: linux-arm-kernel

On Sun, Oct 14, 2018 at 09:49:01PM +0200, Arnd Bergmann wrote:
> On Sat, Oct 13, 2018 at 9:36 PM Andy Lutomirski <luto@amacapital.net> wrote:
> >
> > On Wed, May 16, 2018 at 1:19 AM Yury Norov <ynorov@caviumnetworks.com> wrote:
> > >
> > > This series enables AARCH64 with ILP32 mode.
> > >
> > > As supporting work, it introduces ARCH_32BIT_OFF_T configuration
> > > option that is enabled for existing 32-bit architectures but disabled
> > > for new arches (so 64-bit off_t userspace type is used by new userspace).
> > > Also it deprecates getrlimit and setrlimit syscalls prior to prlimit64.
> >
> > Second, ILP32 user code is highly unlikely
> > to end up with the same struct layout as ILP64 code.  The latter seems
> > like it should be solved entirely in userspace by adding a way to
> > annotate a structure as being a kernel ABI structure and getting the
> > toolchain to lay it out as if it were ILP64 even though the target is
> > ILP32.
> 
> The syscall ABI could be almost completely abstracted in glibc, the
> main issue is ioctl and a couple of related interfaces that pass data
> structures (read() on /dev/input/*, mmap on /dev/snd/*
> or raw sockets, fcntl).

There is another case on struct siginfo which has some pointers and it
wouldn't look like an LP64 structure at all (and glibc doesn't normally
intercept the sighandler call to rewrite the structure). We could add
padding around void * members as the kernel zeros them, I don't recall
the kernel reading these pointers from user. Anyway, using something
that resembles compat_siginfo looked the simplest for ILP32.

-- 
Catalin

^ permalink raw reply	[flat|nested] 104+ messages in thread

* Re: [PATCH v9 00/24] ILP32 for ARM64
  2018-10-13  2:07         ` Eugene Syromiatnikov
  (?)
@ 2018-10-14 19:53           ` Arnd Bergmann
  -1 siblings, 0 replies; 104+ messages in thread
From: Arnd Bergmann @ 2018-10-14 19:53 UTC (permalink / raw)
  To: Eugene Syromiatnikov
  Cc: Szabolcs Nagy, Yury Norov, nd, Catalin Marinas, Linux ARM,
	Linux Kernel Mailing List, open list:DOCUMENTATION, linux-arch,
	Linux API, Adam Borowski, Alexander Graf, Alexey Klimov,
	Andreas Schwab, Andrew Pinski, Bamvor Zhangjian, Chris Metcalf,
	Christoph Muellner, Dave Martin, David Miller, Florian Weimer,
	Geert Uytterhoeven, Heiko Carstens, James Hogan, James Morse,
	Joseph Myers, Lin Yongting, Manuel A. Fernandez Montecelo,
	Mark Brown, Martin Schwidefsky, Maxim Kuvyrkov, Nathan Lynch,
	Philipp Tomsich, Prasun Kapoor, Ramana Radhakrishnan,
	Steve Ellcey, Pavel Machek, Palmer Dabbelt, Wookey

On Sat, Oct 13, 2018 at 4:07 AM Eugene Syromiatnikov <esyr@redhat.com> wrote:
>
> On Wed, Oct 10, 2018 at 03:39:07PM +0100, Szabolcs Nagy wrote:
> > On 10/10/18 15:10, Eugene Syromiatnikov wrote:
> > >  * What's the reasoning behind capping syscall arguments to 32 bit? x32
> > >    and MIPS N32 do not have such a restriction (and do not need special
> > >    wrappers for syscalls that pass 64-bit values as a result, except
> > >    when they do,  as it is the case for preadv2 on x32); moreover, that
> > >    would lead to insurmountable difficulties for AArch64 ILP32 tracers
> > >    that try to trace LP64 tracees, as it would be impossible to pass
> > >    64-bit addresses to process_vm_{read,write} or ptrace PEEK/POKE.
> >
> > but that's necessarily the case for all ilp32 abis:
> > the userspace syscall function receives 32bit
> > arguments so even if the kernel abi takes 64bit
> > args you cannot use that from c code. (the libc
> > does not even know which args should be sign or
> > zero extended.)
>
> glibc's syscall() prototype has kernel_ulong_t as its arguments (more
> specifically, to __syscall_ulong_t, which is 64-bit wide on x32; it
> should also have kernel_long_t as its return type instead of long,
> but that's another story), so it works perfectly fine in case of x32.
>
> > process_vm_readv/writev is limited by the ilp32
> > iovec struct, not by the syscall arguments.
>
> Right, on x32/N32 this issue is worked around by the usage of the respective
> x86_64/N64 call, and it looks like another thing that is impossible
> with AArch64 ilp32.
>
> > ptrace is specified to take void* addr argument,
> > and void* is 32bit on all ilp32 targets.
> > so again on the c language level there is no
> > way around the 32bit limitation.
>
> Which is an issue.

I have no idea why you think this is a problem specific to aarch64-ilp32:
If we want to be able to debug 64-bit tasks from a 32-bit task on any
architecture that has compat mode, we should solve it once and
extend the ptrace interface to allow it on *all* of them. We certainly
don't need /more/ special cases for the x32 hack, there should really
be fewer of them.

      Arnd

^ permalink raw reply	[flat|nested] 104+ messages in thread

* Re: [PATCH v9 00/24] ILP32 for ARM64
@ 2018-10-14 19:53           ` Arnd Bergmann
  0 siblings, 0 replies; 104+ messages in thread
From: Arnd Bergmann @ 2018-10-14 19:53 UTC (permalink / raw)
  To: Eugene Syromiatnikov
  Cc: Szabolcs Nagy, Yury Norov, nd, Catalin Marinas, Linux ARM,
	Linux Kernel Mailing List, open list:DOCUMENTATION, linux-arch,
	Linux API, Adam Borowski, Alexander Graf, Alexey Klimov,
	Andreas Schwab, Andrew Pinski, Bamvor Zhangjian, Chris Metcalf,
	Christoph Muellner, Dave Martin, David Miller

On Sat, Oct 13, 2018 at 4:07 AM Eugene Syromiatnikov <esyr@redhat.com> wrote:
>
> On Wed, Oct 10, 2018 at 03:39:07PM +0100, Szabolcs Nagy wrote:
> > On 10/10/18 15:10, Eugene Syromiatnikov wrote:
> > >  * What's the reasoning behind capping syscall arguments to 32 bit? x32
> > >    and MIPS N32 do not have such a restriction (and do not need special
> > >    wrappers for syscalls that pass 64-bit values as a result, except
> > >    when they do,  as it is the case for preadv2 on x32); moreover, that
> > >    would lead to insurmountable difficulties for AArch64 ILP32 tracers
> > >    that try to trace LP64 tracees, as it would be impossible to pass
> > >    64-bit addresses to process_vm_{read,write} or ptrace PEEK/POKE.
> >
> > but that's necessarily the case for all ilp32 abis:
> > the userspace syscall function receives 32bit
> > arguments so even if the kernel abi takes 64bit
> > args you cannot use that from c code. (the libc
> > does not even know which args should be sign or
> > zero extended.)
>
> glibc's syscall() prototype has kernel_ulong_t as its arguments (more
> specifically, to __syscall_ulong_t, which is 64-bit wide on x32; it
> should also have kernel_long_t as its return type instead of long,
> but that's another story), so it works perfectly fine in case of x32.
>
> > process_vm_readv/writev is limited by the ilp32
> > iovec struct, not by the syscall arguments.
>
> Right, on x32/N32 this issue is worked around by the usage of the respective
> x86_64/N64 call, and it looks like another thing that is impossible
> with AArch64 ilp32.
>
> > ptrace is specified to take void* addr argument,
> > and void* is 32bit on all ilp32 targets.
> > so again on the c language level there is no
> > way around the 32bit limitation.
>
> Which is an issue.

I have no idea why you think this is a problem specific to aarch64-ilp32:
If we want to be able to debug 64-bit tasks from a 32-bit task on any
architecture that has compat mode, we should solve it once and
extend the ptrace interface to allow it on *all* of them. We certainly
don't need /more/ special cases for the x32 hack, there should really
be fewer of them.

      Arnd

^ permalink raw reply	[flat|nested] 104+ messages in thread

* [PATCH v9 00/24] ILP32 for ARM64
@ 2018-10-14 19:53           ` Arnd Bergmann
  0 siblings, 0 replies; 104+ messages in thread
From: Arnd Bergmann @ 2018-10-14 19:53 UTC (permalink / raw)
  To: linux-arm-kernel

On Sat, Oct 13, 2018 at 4:07 AM Eugene Syromiatnikov <esyr@redhat.com> wrote:
>
> On Wed, Oct 10, 2018 at 03:39:07PM +0100, Szabolcs Nagy wrote:
> > On 10/10/18 15:10, Eugene Syromiatnikov wrote:
> > >  * What's the reasoning behind capping syscall arguments to 32 bit? x32
> > >    and MIPS N32 do not have such a restriction (and do not need special
> > >    wrappers for syscalls that pass 64-bit values as a result, except
> > >    when they do,  as it is the case for preadv2 on x32); moreover, that
> > >    would lead to insurmountable difficulties for AArch64 ILP32 tracers
> > >    that try to trace LP64 tracees, as it would be impossible to pass
> > >    64-bit addresses to process_vm_{read,write} or ptrace PEEK/POKE.
> >
> > but that's necessarily the case for all ilp32 abis:
> > the userspace syscall function receives 32bit
> > arguments so even if the kernel abi takes 64bit
> > args you cannot use that from c code. (the libc
> > does not even know which args should be sign or
> > zero extended.)
>
> glibc's syscall() prototype has kernel_ulong_t as its arguments (more
> specifically, to __syscall_ulong_t, which is 64-bit wide on x32; it
> should also have kernel_long_t as its return type instead of long,
> but that's another story), so it works perfectly fine in case of x32.
>
> > process_vm_readv/writev is limited by the ilp32
> > iovec struct, not by the syscall arguments.
>
> Right, on x32/N32 this issue is worked around by the usage of the respective
> x86_64/N64 call, and it looks like another thing that is impossible
> with AArch64 ilp32.
>
> > ptrace is specified to take void* addr argument,
> > and void* is 32bit on all ilp32 targets.
> > so again on the c language level there is no
> > way around the 32bit limitation.
>
> Which is an issue.

I have no idea why you think this is a problem specific to aarch64-ilp32:
If we want to be able to debug 64-bit tasks from a 32-bit task on any
architecture that has compat mode, we should solve it once and
extend the ptrace interface to allow it on *all* of them. We certainly
don't need /more/ special cases for the x32 hack, there should really
be fewer of them.

      Arnd

^ permalink raw reply	[flat|nested] 104+ messages in thread

* Re: [PATCH v9 00/24] ILP32 for ARM64
  2018-10-13 19:36   ` Andy Lutomirski
  (?)
@ 2018-10-14 19:49     ` Arnd Bergmann
  -1 siblings, 0 replies; 104+ messages in thread
From: Arnd Bergmann @ 2018-10-14 19:49 UTC (permalink / raw)
  To: Andy Lutomirski
  Cc: Yury Norov, Catalin Marinas, Linux ARM,
	Linux Kernel Mailing List, open list:DOCUMENTATION, linux-arch,
	Linux API, Adam Borowski, Alexander Graf, Alexey Klimov,
	Andreas Schwab, Andrew Pinski, Bamvor Zhangjian, Chris Metcalf,
	Christoph Muellner, Dave Martin, David Miller, Florian Weimer,
	Geert Uytterhoeven, Heiko Carstens, James Hogan, James Morse,
	Joseph Myers, Lin Yongting, Manuel A. Fernandez Montecelo,
	Mark Brown, Martin Schwidefsky, Maxim Kuvyrkov, Nathan Lynch,
	Philipp Tomsich, Prasun Kapoor, Ramana Radhakrishnan,
	Steve Ellcey, Szabolcs Nagy

On Sat, Oct 13, 2018 at 9:36 PM Andy Lutomirski <luto@amacapital.net> wrote:
>
> On Wed, May 16, 2018 at 1:19 AM Yury Norov <ynorov@caviumnetworks.com> wrote:
> >
> > This series enables AARCH64 with ILP32 mode.
> >
> > As supporting work, it introduces ARCH_32BIT_OFF_T configuration
> > option that is enabled for existing 32-bit architectures but disabled
> > for new arches (so 64-bit off_t userspace type is used by new userspace).
> > Also it deprecates getrlimit and setrlimit syscalls prior to prlimit64.
>
> Second, ILP32 user code is highly unlikely
> to end up with the same struct layout as ILP64 code.  The latter seems
> like it should be solved entirely in userspace by adding a way to
> annotate a structure as being a kernel ABI structure and getting the
> toolchain to lay it out as if it were ILP64 even though the target is
> ILP32.

The syscall ABI could be almost completely abstracted in glibc, the
main issue is ioctl and a couple of related interfaces that pass data
structures (read() on /dev/input/*, mmap on /dev/snd/*
or raw sockets, fcntl).

The question whether a data type is laid out like a 64-bit architecture
would cannot be a property of the type in most of those cases,
because the same types are used elsewhere. Many ioctls just
take a pointer to a 'long' or similar, and then you have structures
like 'timespec' that are used both in syscall/ioctl ABI and in normal
user space code, but are required to be laid out differently there.
(timespec is a bad example because y2038 of course, but it
illustrates the point).

> 2. I think you should make a conscious decision as to whether the
> ILP32-ness of a syscall is a property of the task or of the syscall.
> On x86, x32-ness is a property of the syscall, but historically it
> also got rather entangled with the state of the task, and the result
> was a mess.  It looks like you're making it be a property of the task,
> which is fine, but you're making it impossible for very clever ILP32
> libraries to include little ILP64 stubs that do fancy things with full
> 64-bit syscalls.
>
> 3. Make very certain that you aren't exploitable by malicious
> processes that set the high bits in ILP32 syscall args.  x86 compat
> has issues like that in the past.

This point was actually the most important one for keeping the
aarch64 ilp32 interface as restricted as it is: it doesn't allow
anything that the normal aarch32/armv7 emulation doesn't
already provide.

        Arnd

^ permalink raw reply	[flat|nested] 104+ messages in thread

* Re: [PATCH v9 00/24] ILP32 for ARM64
@ 2018-10-14 19:49     ` Arnd Bergmann
  0 siblings, 0 replies; 104+ messages in thread
From: Arnd Bergmann @ 2018-10-14 19:49 UTC (permalink / raw)
  To: Andy Lutomirski
  Cc: Yury Norov, Catalin Marinas, Linux ARM,
	Linux Kernel Mailing List, open list:DOCUMENTATION, linux-arch,
	Linux API, Adam Borowski, Alexander Graf, Alexey Klimov,
	Andreas Schwab, Andrew Pinski, Bamvor Zhangjian, Chris Metcalf,
	Christoph Muellner, Dave Martin, David Miller, Florian Weimer

On Sat, Oct 13, 2018 at 9:36 PM Andy Lutomirski <luto@amacapital.net> wrote:
>
> On Wed, May 16, 2018 at 1:19 AM Yury Norov <ynorov@caviumnetworks.com> wrote:
> >
> > This series enables AARCH64 with ILP32 mode.
> >
> > As supporting work, it introduces ARCH_32BIT_OFF_T configuration
> > option that is enabled for existing 32-bit architectures but disabled
> > for new arches (so 64-bit off_t userspace type is used by new userspace).
> > Also it deprecates getrlimit and setrlimit syscalls prior to prlimit64.
>
> Second, ILP32 user code is highly unlikely
> to end up with the same struct layout as ILP64 code.  The latter seems
> like it should be solved entirely in userspace by adding a way to
> annotate a structure as being a kernel ABI structure and getting the
> toolchain to lay it out as if it were ILP64 even though the target is
> ILP32.

The syscall ABI could be almost completely abstracted in glibc, the
main issue is ioctl and a couple of related interfaces that pass data
structures (read() on /dev/input/*, mmap on /dev/snd/*
or raw sockets, fcntl).

The question whether a data type is laid out like a 64-bit architecture
would cannot be a property of the type in most of those cases,
because the same types are used elsewhere. Many ioctls just
take a pointer to a 'long' or similar, and then you have structures
like 'timespec' that are used both in syscall/ioctl ABI and in normal
user space code, but are required to be laid out differently there.
(timespec is a bad example because y2038 of course, but it
illustrates the point).

> 2. I think you should make a conscious decision as to whether the
> ILP32-ness of a syscall is a property of the task or of the syscall.
> On x86, x32-ness is a property of the syscall, but historically it
> also got rather entangled with the state of the task, and the result
> was a mess.  It looks like you're making it be a property of the task,
> which is fine, but you're making it impossible for very clever ILP32
> libraries to include little ILP64 stubs that do fancy things with full
> 64-bit syscalls.
>
> 3. Make very certain that you aren't exploitable by malicious
> processes that set the high bits in ILP32 syscall args.  x86 compat
> has issues like that in the past.

This point was actually the most important one for keeping the
aarch64 ilp32 interface as restricted as it is: it doesn't allow
anything that the normal aarch32/armv7 emulation doesn't
already provide.

        Arnd

^ permalink raw reply	[flat|nested] 104+ messages in thread

* [PATCH v9 00/24] ILP32 for ARM64
@ 2018-10-14 19:49     ` Arnd Bergmann
  0 siblings, 0 replies; 104+ messages in thread
From: Arnd Bergmann @ 2018-10-14 19:49 UTC (permalink / raw)
  To: linux-arm-kernel

On Sat, Oct 13, 2018 at 9:36 PM Andy Lutomirski <luto@amacapital.net> wrote:
>
> On Wed, May 16, 2018 at 1:19 AM Yury Norov <ynorov@caviumnetworks.com> wrote:
> >
> > This series enables AARCH64 with ILP32 mode.
> >
> > As supporting work, it introduces ARCH_32BIT_OFF_T configuration
> > option that is enabled for existing 32-bit architectures but disabled
> > for new arches (so 64-bit off_t userspace type is used by new userspace).
> > Also it deprecates getrlimit and setrlimit syscalls prior to prlimit64.
>
> Second, ILP32 user code is highly unlikely
> to end up with the same struct layout as ILP64 code.  The latter seems
> like it should be solved entirely in userspace by adding a way to
> annotate a structure as being a kernel ABI structure and getting the
> toolchain to lay it out as if it were ILP64 even though the target is
> ILP32.

The syscall ABI could be almost completely abstracted in glibc, the
main issue is ioctl and a couple of related interfaces that pass data
structures (read() on /dev/input/*, mmap on /dev/snd/*
or raw sockets, fcntl).

The question whether a data type is laid out like a 64-bit architecture
would cannot be a property of the type in most of those cases,
because the same types are used elsewhere. Many ioctls just
take a pointer to a 'long' or similar, and then you have structures
like 'timespec' that are used both in syscall/ioctl ABI and in normal
user space code, but are required to be laid out differently there.
(timespec is a bad example because y2038 of course, but it
illustrates the point).

> 2. I think you should make a conscious decision as to whether the
> ILP32-ness of a syscall is a property of the task or of the syscall.
> On x86, x32-ness is a property of the syscall, but historically it
> also got rather entangled with the state of the task, and the result
> was a mess.  It looks like you're making it be a property of the task,
> which is fine, but you're making it impossible for very clever ILP32
> libraries to include little ILP64 stubs that do fancy things with full
> 64-bit syscalls.
>
> 3. Make very certain that you aren't exploitable by malicious
> processes that set the high bits in ILP32 syscall args.  x86 compat
> has issues like that in the past.

This point was actually the most important one for keeping the
aarch64 ilp32 interface as restricted as it is: it doesn't allow
anything that the normal aarch32/armv7 emulation doesn't
already provide.

        Arnd

^ permalink raw reply	[flat|nested] 104+ messages in thread

* Re: [PATCH v9 00/24] ILP32 for ARM64
  2018-05-16  8:18 ` Yury Norov
  (?)
@ 2018-10-13 19:36   ` Andy Lutomirski
  -1 siblings, 0 replies; 104+ messages in thread
From: Andy Lutomirski @ 2018-10-13 19:36 UTC (permalink / raw)
  To: ynorov
  Cc: Catalin Marinas, Arnd Bergmann, linux-arm-kernel, LKML,
	linux-doc, linux-arch, Linux API, Adam Borowski, Alexander Graf,
	klimov.linux, schwab, Andrew Pinski, bamv2005, Chris Metcalf,
	christoph.muellner, Dave Martin, David S. Miller, Florian Weimer,
	Geert Uytterhoeven, Heiko Carstens, James Hogan, James Morse,
	Joseph S. Myers, linyongting, manuel.montezelo, Mark Brown,
	Martin Schwidefsky, Maxim Kuvyrkov, Nathan Lynch,
	philipp.tomsich, Prasun.Kapoor, ramana.gcc, sellcey,
	szabolcs.nagy

On Wed, May 16, 2018 at 1:19 AM Yury Norov <ynorov@caviumnetworks.com> wrote:
>
> This series enables AARCH64 with ILP32 mode.
>
> As supporting work, it introduces ARCH_32BIT_OFF_T configuration
> option that is enabled for existing 32-bit architectures but disabled
> for new arches (so 64-bit off_t userspace type is used by new userspace).
> Also it deprecates getrlimit and setrlimit syscalls prior to prlimit64.

A few thoughts:

1. I've never been able to shake the feeling that x32 should not need
kernel support at all.  As far as I can tell, the kernel support is an
enormous amount of code and complexity to deal with exactly two
issues.  First, ILP32 only has 32-bit pointers, so there needs to be a
way to tell the kernel to only use the lower 4 GB of user address
space.  That part is easy.  Second, ILP32 user code is highly unlikely
to end up with the same struct layout as ILP64 code.  The latter seems
like it should be solved entirely in userspace by adding a way to
annotate a structure as being a kernel ABI structure and getting the
toolchain to lay it out as if it were ILP64 even though the target is
ILP32.

2. I think you should make a conscious decision as to whether the
ILP32-ness of a syscall is a property of the task or of the syscall.
On x86, x32-ness is a property of the syscall, but historically it
also got rather entangled with the state of the task, and the result
was a mess.  It looks like you're making it be a property of the task,
which is fine, but you're making it impossible for very clever ILP32
libraries to include little ILP64 stubs that do fancy things with full
64-bit syscalls.

3. Make very certain that you aren't exploitable by malicious
processes that set the high bits in ILP32 syscall args.  x86 compat
has issues like that in the past.

^ permalink raw reply	[flat|nested] 104+ messages in thread

* Re: [PATCH v9 00/24] ILP32 for ARM64
@ 2018-10-13 19:36   ` Andy Lutomirski
  0 siblings, 0 replies; 104+ messages in thread
From: Andy Lutomirski @ 2018-10-13 19:36 UTC (permalink / raw)
  To: ynorov
  Cc: Catalin Marinas, Arnd Bergmann, linux-arm-kernel, LKML,
	linux-doc, linux-arch, Linux API, Adam Borowski, Alexander Graf,
	klimov.linux, schwab, Andrew Pinski, bamv2005, Chris Metcalf,
	christoph.muellner, Dave Martin, David S. Miller, Florian Weimer,
	Geert Uytterhoeven, Heiko Carstens, James Hogan

On Wed, May 16, 2018 at 1:19 AM Yury Norov <ynorov@caviumnetworks.com> wrote:
>
> This series enables AARCH64 with ILP32 mode.
>
> As supporting work, it introduces ARCH_32BIT_OFF_T configuration
> option that is enabled for existing 32-bit architectures but disabled
> for new arches (so 64-bit off_t userspace type is used by new userspace).
> Also it deprecates getrlimit and setrlimit syscalls prior to prlimit64.

A few thoughts:

1. I've never been able to shake the feeling that x32 should not need
kernel support at all.  As far as I can tell, the kernel support is an
enormous amount of code and complexity to deal with exactly two
issues.  First, ILP32 only has 32-bit pointers, so there needs to be a
way to tell the kernel to only use the lower 4 GB of user address
space.  That part is easy.  Second, ILP32 user code is highly unlikely
to end up with the same struct layout as ILP64 code.  The latter seems
like it should be solved entirely in userspace by adding a way to
annotate a structure as being a kernel ABI structure and getting the
toolchain to lay it out as if it were ILP64 even though the target is
ILP32.

2. I think you should make a conscious decision as to whether the
ILP32-ness of a syscall is a property of the task or of the syscall.
On x86, x32-ness is a property of the syscall, but historically it
also got rather entangled with the state of the task, and the result
was a mess.  It looks like you're making it be a property of the task,
which is fine, but you're making it impossible for very clever ILP32
libraries to include little ILP64 stubs that do fancy things with full
64-bit syscalls.

3. Make very certain that you aren't exploitable by malicious
processes that set the high bits in ILP32 syscall args.  x86 compat
has issues like that in the past.

^ permalink raw reply	[flat|nested] 104+ messages in thread

* [PATCH v9 00/24] ILP32 for ARM64
@ 2018-10-13 19:36   ` Andy Lutomirski
  0 siblings, 0 replies; 104+ messages in thread
From: Andy Lutomirski @ 2018-10-13 19:36 UTC (permalink / raw)
  To: linux-arm-kernel

On Wed, May 16, 2018 at 1:19 AM Yury Norov <ynorov@caviumnetworks.com> wrote:
>
> This series enables AARCH64 with ILP32 mode.
>
> As supporting work, it introduces ARCH_32BIT_OFF_T configuration
> option that is enabled for existing 32-bit architectures but disabled
> for new arches (so 64-bit off_t userspace type is used by new userspace).
> Also it deprecates getrlimit and setrlimit syscalls prior to prlimit64.

A few thoughts:

1. I've never been able to shake the feeling that x32 should not need
kernel support at all.  As far as I can tell, the kernel support is an
enormous amount of code and complexity to deal with exactly two
issues.  First, ILP32 only has 32-bit pointers, so there needs to be a
way to tell the kernel to only use the lower 4 GB of user address
space.  That part is easy.  Second, ILP32 user code is highly unlikely
to end up with the same struct layout as ILP64 code.  The latter seems
like it should be solved entirely in userspace by adding a way to
annotate a structure as being a kernel ABI structure and getting the
toolchain to lay it out as if it were ILP64 even though the target is
ILP32.

2. I think you should make a conscious decision as to whether the
ILP32-ness of a syscall is a property of the task or of the syscall.
On x86, x32-ness is a property of the syscall, but historically it
also got rather entangled with the state of the task, and the result
was a mess.  It looks like you're making it be a property of the task,
which is fine, but you're making it impossible for very clever ILP32
libraries to include little ILP64 stubs that do fancy things with full
64-bit syscalls.

3. Make very certain that you aren't exploitable by malicious
processes that set the high bits in ILP32 syscall args.  x86 compat
has issues like that in the past.

^ permalink raw reply	[flat|nested] 104+ messages in thread

* Re: [PATCH v9 00/24] ILP32 for ARM64
  2018-10-13  9:34           ` Catalin Marinas
  (?)
@ 2018-10-13 16:54             ` Andy Lutomirski
  -1 siblings, 0 replies; 104+ messages in thread
From: Andy Lutomirski @ 2018-10-13 16:54 UTC (permalink / raw)
  To: Catalin Marinas
  Cc: Eugene Syromiatnikov, linux-doc, szabolcs.nagy, palmer,
	Heiko Carstens, ynorov, Pavel Machek, philipp.tomsich,
	Joseph S. Myers, linux-arch, sellcey, Prasun.Kapoor, schwab,
	Alexander Graf, bamv2005, Geert Uytterhoeven, Dave Martin,
	Adam Borowski, manuel.montezelo, James Hogan, Chris Metcalf,
	Arnd Bergmann, Andrew Pinski, linyongting, klimov.linux, wookey,
	Mark Brown, linux-arm-kernel, Maxim Kuvyrkov, Florian Weimer,
	Linux API, Nathan Lynch, LKML, James Morse, ramana.gcc,
	Martin Schwidefsky, David S. Miller, christoph.muellner

> On Oct 13, 2018, at 2:34 AM, Catalin Marinas <catalin.marinas@arm.com> wrote:
>
>> On Sat, Oct 13, 2018 at 04:14:16AM +0200, Eugene Syromiatnikov wrote:
>>> On Wed, Oct 10, 2018 at 04:36:56PM +0100, Catalin Marinas wrote:
>>>> On Wed, Oct 10, 2018 at 04:10:21PM +0200, Eugene Syromiatnikov wrote:
>>>> I have some questions regarding AArch64 ILP32 implementation for which I
>>>> failed to find an answer myself:
>>>> * How ptrace() tracer is supposed to distinguish between ILP32 and LP64
>>>>   tracees? For MIPS N32 and x32 this is possible based on syscall
>>>>   number, but for AArch64 ILP32 I do not see such a sign. There's also
>>>>   ARM_ip is employed for signalling entering/exiting, I wonder whether
>>>>   it's possible to employ it also for signalling tracee's personality.
>>>
>>> With the current implementation, I don't think you can distinguish. From
>>> the kernel perspective, the register set is the same. What is the
>>> use-case for this?
>>
>> Err, a ptrace()-based tracer trying to trace a process, for example?
>
> I first thought it wouldn't matter for ptrace-based tracers since the
> syscall numbers are (mostly) the same. But the arguments layout in
> register is indeed different, so I see your point now about having to
> distinguish.
>
>>> We could add a new regset to expose the ILP32 state (NT_ARM_..., I can't
>>> think of a name now but probably not PER* as this implies PER_LINUX_...
>>> which is independent from TIF_32BIT_*).
>>
>> So that would require an additional ptrace() call on each syscall stop,
>> is that correct?
>
> The ILP32 state does not change at run-time, so it could only do a
> ptrace() call once and save the information. No need to re-read it on
> each syscall stop.
>

Please solve this in an arch independent way.  This situation is
basically unusably broken on x86 right now.  Please solve it for real,
by, for example, adding a new ptrace operation that returns something
like this:

enum ptrace_syscall_state {
  NO_SYSCALL,
  SYSCALL_ENTRY,
  SYSCALL_EXIT,
  /* other values may be defined in the future. */
};

struct ptrace_syscall_info {
  enum ptrace_syscall_state state;
  unsigned long arch;
  union {
    struct {
      unsigned long nr;
      unsigned long args[6];
   } entry;
   struct {
      unsigned long ret;
   } exit;
};

where arch is an AUDIT_ARCH_XYZ constant.

On x86, it's currently essentially impossible for tools like strace to
correctly decode syscalls.

> We could set a high bit in the syscall number reported to the ptrace
> caller (though not changing the syscall ABI) but I haven't thought of
> other consequences. For example, can the ptrace caller change the
> syscall number?

Yes it can.

>
>>>> * What's the reasoning behind capping syscall arguments to 32 bit? x32
>>>>   and MIPS N32 do not have such a restriction (and do not need special
>>>>   wrappers for syscalls that pass 64-bit values as a result, except
>>>>   when they do,  as it is the case for preadv2 on x32); moreover, that
>>>>   would lead to insurmountable difficulties for AArch64 ILP32 tracers
>>>>   that try to trace LP64 tracees, as it would be impossible to pass
>>>>   64-bit addresses to process_vm_{read,write} or ptrace PEEK/POKE.
>>>
>>> We've attempted in earlier versions to allow a mix of 32 and 64-bit
>>> register values from ILP32 but it got pretty complicated. The entry code
>>> would need to know which registers need zeroing of the top 32-bit
>>
>> If kernel specifies 64-bit wide registers for syscalls, then it's the
>> caller's (libc's) responsibility to properly sign-extend arguments when
>> needed, and glibc, for example, already has proper type definitions that
>> aimed to handle this.
>
> We tried, see my other reply.
>
> --
> Catalin

^ permalink raw reply	[flat|nested] 104+ messages in thread

* Re: [PATCH v9 00/24] ILP32 for ARM64
@ 2018-10-13 16:54             ` Andy Lutomirski
  0 siblings, 0 replies; 104+ messages in thread
From: Andy Lutomirski @ 2018-10-13 16:54 UTC (permalink / raw)
  To: Catalin Marinas
  Cc: Eugene Syromiatnikov, linux-doc, szabolcs.nagy, palmer,
	Heiko Carstens, ynorov, Pavel Machek, philipp.tomsich,
	Joseph S. Myers, linux-arch, sellcey, Prasun.Kapoor, schwab,
	Alexander Graf, bamv2005, Geert Uytterhoeven, Dave Martin,
	Adam Borowski, manuel.montezelo, James Hogan, Chris Metcalf,
	Arnd Bergmann, Andrew Pinski, linyongting

> On Oct 13, 2018, at 2:34 AM, Catalin Marinas <catalin.marinas@arm.com> wrote:
>
>> On Sat, Oct 13, 2018 at 04:14:16AM +0200, Eugene Syromiatnikov wrote:
>>> On Wed, Oct 10, 2018 at 04:36:56PM +0100, Catalin Marinas wrote:
>>>> On Wed, Oct 10, 2018 at 04:10:21PM +0200, Eugene Syromiatnikov wrote:
>>>> I have some questions regarding AArch64 ILP32 implementation for which I
>>>> failed to find an answer myself:
>>>> * How ptrace() tracer is supposed to distinguish between ILP32 and LP64
>>>>   tracees? For MIPS N32 and x32 this is possible based on syscall
>>>>   number, but for AArch64 ILP32 I do not see such a sign. There's also
>>>>   ARM_ip is employed for signalling entering/exiting, I wonder whether
>>>>   it's possible to employ it also for signalling tracee's personality.
>>>
>>> With the current implementation, I don't think you can distinguish. From
>>> the kernel perspective, the register set is the same. What is the
>>> use-case for this?
>>
>> Err, a ptrace()-based tracer trying to trace a process, for example?
>
> I first thought it wouldn't matter for ptrace-based tracers since the
> syscall numbers are (mostly) the same. But the arguments layout in
> register is indeed different, so I see your point now about having to
> distinguish.
>
>>> We could add a new regset to expose the ILP32 state (NT_ARM_..., I can't
>>> think of a name now but probably not PER* as this implies PER_LINUX_...
>>> which is independent from TIF_32BIT_*).
>>
>> So that would require an additional ptrace() call on each syscall stop,
>> is that correct?
>
> The ILP32 state does not change at run-time, so it could only do a
> ptrace() call once and save the information. No need to re-read it on
> each syscall stop.
>

Please solve this in an arch independent way.  This situation is
basically unusably broken on x86 right now.  Please solve it for real,
by, for example, adding a new ptrace operation that returns something
like this:

enum ptrace_syscall_state {
  NO_SYSCALL,
  SYSCALL_ENTRY,
  SYSCALL_EXIT,
  /* other values may be defined in the future. */
};

struct ptrace_syscall_info {
  enum ptrace_syscall_state state;
  unsigned long arch;
  union {
    struct {
      unsigned long nr;
      unsigned long args[6];
   } entry;
   struct {
      unsigned long ret;
   } exit;
};

where arch is an AUDIT_ARCH_XYZ constant.

On x86, it's currently essentially impossible for tools like strace to
correctly decode syscalls.

> We could set a high bit in the syscall number reported to the ptrace
> caller (though not changing the syscall ABI) but I haven't thought of
> other consequences. For example, can the ptrace caller change the
> syscall number?

Yes it can.

>
>>>> * What's the reasoning behind capping syscall arguments to 32 bit? x32
>>>>   and MIPS N32 do not have such a restriction (and do not need special
>>>>   wrappers for syscalls that pass 64-bit values as a result, except
>>>>   when they do,  as it is the case for preadv2 on x32); moreover, that
>>>>   would lead to insurmountable difficulties for AArch64 ILP32 tracers
>>>>   that try to trace LP64 tracees, as it would be impossible to pass
>>>>   64-bit addresses to process_vm_{read,write} or ptrace PEEK/POKE.
>>>
>>> We've attempted in earlier versions to allow a mix of 32 and 64-bit
>>> register values from ILP32 but it got pretty complicated. The entry code
>>> would need to know which registers need zeroing of the top 32-bit
>>
>> If kernel specifies 64-bit wide registers for syscalls, then it's the
>> caller's (libc's) responsibility to properly sign-extend arguments when
>> needed, and glibc, for example, already has proper type definitions that
>> aimed to handle this.
>
> We tried, see my other reply.
>
> --
> Catalin

^ permalink raw reply	[flat|nested] 104+ messages in thread

* [PATCH v9 00/24] ILP32 for ARM64
@ 2018-10-13 16:54             ` Andy Lutomirski
  0 siblings, 0 replies; 104+ messages in thread
From: Andy Lutomirski @ 2018-10-13 16:54 UTC (permalink / raw)
  To: linux-arm-kernel

> On Oct 13, 2018, at 2:34 AM, Catalin Marinas <catalin.marinas@arm.com> wrote:
>
>> On Sat, Oct 13, 2018 at 04:14:16AM +0200, Eugene Syromiatnikov wrote:
>>> On Wed, Oct 10, 2018 at 04:36:56PM +0100, Catalin Marinas wrote:
>>>> On Wed, Oct 10, 2018 at 04:10:21PM +0200, Eugene Syromiatnikov wrote:
>>>> I have some questions regarding AArch64 ILP32 implementation for which I
>>>> failed to find an answer myself:
>>>> * How ptrace() tracer is supposed to distinguish between ILP32 and LP64
>>>>   tracees? For MIPS N32 and x32 this is possible based on syscall
>>>>   number, but for AArch64 ILP32 I do not see such a sign. There's also
>>>>   ARM_ip is employed for signalling entering/exiting, I wonder whether
>>>>   it's possible to employ it also for signalling tracee's personality.
>>>
>>> With the current implementation, I don't think you can distinguish. From
>>> the kernel perspective, the register set is the same. What is the
>>> use-case for this?
>>
>> Err, a ptrace()-based tracer trying to trace a process, for example?
>
> I first thought it wouldn't matter for ptrace-based tracers since the
> syscall numbers are (mostly) the same. But the arguments layout in
> register is indeed different, so I see your point now about having to
> distinguish.
>
>>> We could add a new regset to expose the ILP32 state (NT_ARM_..., I can't
>>> think of a name now but probably not PER* as this implies PER_LINUX_...
>>> which is independent from TIF_32BIT_*).
>>
>> So that would require an additional ptrace() call on each syscall stop,
>> is that correct?
>
> The ILP32 state does not change at run-time, so it could only do a
> ptrace() call once and save the information. No need to re-read it on
> each syscall stop.
>

Please solve this in an arch independent way.  This situation is
basically unusably broken on x86 right now.  Please solve it for real,
by, for example, adding a new ptrace operation that returns something
like this:

enum ptrace_syscall_state {
  NO_SYSCALL,
  SYSCALL_ENTRY,
  SYSCALL_EXIT,
  /* other values may be defined in the future. */
};

struct ptrace_syscall_info {
  enum ptrace_syscall_state state;
  unsigned long arch;
  union {
    struct {
      unsigned long nr;
      unsigned long args[6];
   } entry;
   struct {
      unsigned long ret;
   } exit;
};

where arch is an AUDIT_ARCH_XYZ constant.

On x86, it's currently essentially impossible for tools like strace to
correctly decode syscalls.

> We could set a high bit in the syscall number reported to the ptrace
> caller (though not changing the syscall ABI) but I haven't thought of
> other consequences. For example, can the ptrace caller change the
> syscall number?

Yes it can.

>
>>>> * What's the reasoning behind capping syscall arguments to 32 bit? x32
>>>>   and MIPS N32 do not have such a restriction (and do not need special
>>>>   wrappers for syscalls that pass 64-bit values as a result, except
>>>>   when they do,  as it is the case for preadv2 on x32); moreover, that
>>>>   would lead to insurmountable difficulties for AArch64 ILP32 tracers
>>>>   that try to trace LP64 tracees, as it would be impossible to pass
>>>>   64-bit addresses to process_vm_{read,write} or ptrace PEEK/POKE.
>>>
>>> We've attempted in earlier versions to allow a mix of 32 and 64-bit
>>> register values from ILP32 but it got pretty complicated. The entry code
>>> would need to know which registers need zeroing of the top 32-bit
>>
>> If kernel specifies 64-bit wide registers for syscalls, then it's the
>> caller's (libc's) responsibility to properly sign-extend arguments when
>> needed, and glibc, for example, already has proper type definitions that
>> aimed to handle this.
>
> We tried, see my other reply.
>
> --
> Catalin

^ permalink raw reply	[flat|nested] 104+ messages in thread

* Re: [PATCH v9 00/24] ILP32 for ARM64
  2018-10-13  9:34           ` Catalin Marinas
  (?)
  (?)
@ 2018-10-13 13:43             ` Yury Norov
  -1 siblings, 0 replies; 104+ messages in thread
From: Yury Norov @ 2018-10-13 13:43 UTC (permalink / raw)
  To: Catalin Marinas
  Cc: Eugene Syromiatnikov, linux-doc, Szabolcs Nagy, Palmer Dabbelt,
	Heiko Carstens, Pavel Machek, Philipp Tomsich, Joseph Myers,
	linux-arch, Ellcey, Steve, Kapoor, Prasun, Andreas Schwab,
	Alexander Graf, Bamvor Zhangjian, Geert Uytterhoeven,
	Dave Martin, Adam Borowski, Manuel Montezelo, James Hogan,
	Chris Metcalf, Arnd Bergmann, Andrew Pinski, Lin Yongting,
	Alexey Klimov, Wookey, Mark Brown, linux-arm-kernel,
	Maxim Kuvyrkov, Florian Weimer, linux-api, Nathan_Lynch,
	linux-kernel, James Morse, Ramana Radhakrishnan,
	Martin Schwidefsky, David S . Miller, Christoph Muellner

On Sat, Oct 13, 2018 at 10:34:11AM +0100, Catalin Marinas wrote:
> 
> Lines: 73
> 
> External Email
> 
> On Sat, Oct 13, 2018 at 04:14:16AM +0200, Eugene Syromiatnikov wrote:
> > On Wed, Oct 10, 2018 at 04:36:56PM +0100, Catalin Marinas wrote:
> > > On Wed, Oct 10, 2018 at 04:10:21PM +0200, Eugene Syromiatnikov wrote:
> > > > I have some questions regarding AArch64 ILP32 implementation for which I
> > > > failed to find an answer myself:
> > > >  * How ptrace() tracer is supposed to distinguish between ILP32 and LP64
> > > >    tracees? For MIPS N32 and x32 this is possible based on syscall
> > > >    number, but for AArch64 ILP32 I do not see such a sign. There's also
> > > >    ARM_ip is employed for signalling entering/exiting, I wonder whether
> > > >    it's possible to employ it also for signalling tracee's personality.
> > >
> > > With the current implementation, I don't think you can distinguish. From
> > > the kernel perspective, the register set is the same. What is the
> > > use-case for this?
> >
> > Err, a ptrace()-based tracer trying to trace a process, for example?
> 
> I first thought it wouldn't matter for ptrace-based tracers since the
> syscall numbers are (mostly) the same. But the arguments layout in
> register is indeed different, so I see your point now about having to
> distinguish.
> 
> > > We could add a new regset to expose the ILP32 state (NT_ARM_..., I can't
> > > think of a name now but probably not PER* as this implies PER_LINUX_...
> > > which is independent from TIF_32BIT_*).
> >
> > So that would require an additional ptrace() call on each syscall stop,
> > is that correct?
> 
> The ILP32 state does not change at run-time, so it could only do a
> ptrace() call once and save the information. No need to re-read it on
> each syscall stop.
> 
> We could set a high bit in the syscall number reported to the ptrace
> caller (though not changing the syscall ABI) but I haven't thought of
> other consequences. For example, can the ptrace caller change the
> syscall number?

I believe, /proc/PID/auxv is enough to distinguish between arm64, ilp32
and aarch32 ABis. If no, I think it's better to do it there.

I don't have ILP32 machine available at the moment, but I'll check it soon. 

> > > >  * What's the reasoning behind capping syscall arguments to 32 bit? x32
> > > >    and MIPS N32 do not have such a restriction (and do not need special
> > > >    wrappers for syscalls that pass 64-bit values as a result, except
> > > >    when they do,  as it is the case for preadv2 on x32); moreover, that
> > > >    would lead to insurmountable difficulties for AArch64 ILP32 tracers
> > > >    that try to trace LP64 tracees, as it would be impossible to pass
> > > >    64-bit addresses to process_vm_{read,write} or ptrace PEEK/POKE.
> > >
> > > We've attempted in earlier versions to allow a mix of 32 and 64-bit
> > > register values from ILP32 but it got pretty complicated. The entry code
> > > would need to know which registers need zeroing of the top 32-bit
> >
> > If kernel specifies 64-bit wide registers for syscalls, then it's the
> > caller's (libc's) responsibility to properly sign-extend arguments when
> > needed, and glibc, for example, already has proper type definitions that
> > aimed to handle this.
> 
> We tried, see my other reply.

A couple of links to recall the story:
https://www.spinics.net/lists/linux-s390/msg11593.html
http://linux-kernel.2935.n7.nabble.com/RFC6-PATCH-v6-00-21-ILP32-for-ARM64-td1345105.html

Cover-letter of the series has links to previous discussions.

I would also notice that even if we pass 64-bit parameters in a single
register, we cannot avoid using the compat layer. It looks more natural
not to split the 64-bit register, but from performance point of view
there is almost no difference, either we split registers or not (2.6%
for empty syscall, as I measured). And the cost of overcomplication was
considered too much. So we chose to stick to more standard compat layer
and gain in maintainability. 

Yury


^ permalink raw reply	[flat|nested] 104+ messages in thread

* Re: [PATCH v9 00/24] ILP32 for ARM64
@ 2018-10-13 13:43             ` Yury Norov
  0 siblings, 0 replies; 104+ messages in thread
From: Yury Norov @ 2018-10-13 13:43 UTC (permalink / raw)
  To: Catalin Marinas
  Cc: Eugene Syromiatnikov, linux-doc, Szabolcs Nagy, Palmer Dabbelt,
	Heiko Carstens, Pavel Machek, Philipp Tomsich, Joseph Myers,
	linux-arch, Ellcey, Steve, Kapoor, Prasun, Andreas Schwab,
	Alexander Graf, Bamvor Zhangjian, Geert Uytterhoeven,
	Dave Martin, Adam Borowski, Manuel Montezelo

On Sat, Oct 13, 2018 at 10:34:11AM +0100, Catalin Marinas wrote:
> 
> Lines: 73
> 
> External Email
> 
> On Sat, Oct 13, 2018 at 04:14:16AM +0200, Eugene Syromiatnikov wrote:
> > On Wed, Oct 10, 2018 at 04:36:56PM +0100, Catalin Marinas wrote:
> > > On Wed, Oct 10, 2018 at 04:10:21PM +0200, Eugene Syromiatnikov wrote:
> > > > I have some questions regarding AArch64 ILP32 implementation for which I
> > > > failed to find an answer myself:
> > > >  * How ptrace() tracer is supposed to distinguish between ILP32 and LP64
> > > >    tracees? For MIPS N32 and x32 this is possible based on syscall
> > > >    number, but for AArch64 ILP32 I do not see such a sign. There's also
> > > >    ARM_ip is employed for signalling entering/exiting, I wonder whether
> > > >    it's possible to employ it also for signalling tracee's personality.
> > >
> > > With the current implementation, I don't think you can distinguish. From
> > > the kernel perspective, the register set is the same. What is the
> > > use-case for this?
> >
> > Err, a ptrace()-based tracer trying to trace a process, for example?
> 
> I first thought it wouldn't matter for ptrace-based tracers since the
> syscall numbers are (mostly) the same. But the arguments layout in
> register is indeed different, so I see your point now about having to
> distinguish.
> 
> > > We could add a new regset to expose the ILP32 state (NT_ARM_..., I can't
> > > think of a name now but probably not PER* as this implies PER_LINUX_...
> > > which is independent from TIF_32BIT_*).
> >
> > So that would require an additional ptrace() call on each syscall stop,
> > is that correct?
> 
> The ILP32 state does not change at run-time, so it could only do a
> ptrace() call once and save the information. No need to re-read it on
> each syscall stop.
> 
> We could set a high bit in the syscall number reported to the ptrace
> caller (though not changing the syscall ABI) but I haven't thought of
> other consequences. For example, can the ptrace caller change the
> syscall number?

I believe, /proc/PID/auxv is enough to distinguish between arm64, ilp32
and aarch32 ABis. If no, I think it's better to do it there.

I don't have ILP32 machine available at the moment, but I'll check it soon. 

> > > >  * What's the reasoning behind capping syscall arguments to 32 bit? x32
> > > >    and MIPS N32 do not have such a restriction (and do not need special
> > > >    wrappers for syscalls that pass 64-bit values as a result, except
> > > >    when they do,  as it is the case for preadv2 on x32); moreover, that
> > > >    would lead to insurmountable difficulties for AArch64 ILP32 tracers
> > > >    that try to trace LP64 tracees, as it would be impossible to pass
> > > >    64-bit addresses to process_vm_{read,write} or ptrace PEEK/POKE.
> > >
> > > We've attempted in earlier versions to allow a mix of 32 and 64-bit
> > > register values from ILP32 but it got pretty complicated. The entry code
> > > would need to know which registers need zeroing of the top 32-bit
> >
> > If kernel specifies 64-bit wide registers for syscalls, then it's the
> > caller's (libc's) responsibility to properly sign-extend arguments when
> > needed, and glibc, for example, already has proper type definitions that
> > aimed to handle this.
> 
> We tried, see my other reply.

A couple of links to recall the story:
https://www.spinics.net/lists/linux-s390/msg11593.html
http://linux-kernel.2935.n7.nabble.com/RFC6-PATCH-v6-00-21-ILP32-for-ARM64-td1345105.html

Cover-letter of the series has links to previous discussions.

I would also notice that even if we pass 64-bit parameters in a single
register, we cannot avoid using the compat layer. It looks more natural
not to split the 64-bit register, but from performance point of view
there is almost no difference, either we split registers or not (2.6%
for empty syscall, as I measured). And the cost of overcomplication was
considered too much. So we chose to stick to more standard compat layer
and gain in maintainability. 

Yury

^ permalink raw reply	[flat|nested] 104+ messages in thread

* Re: [PATCH v9 00/24] ILP32 for ARM64
@ 2018-10-13 13:43             ` Yury Norov
  0 siblings, 0 replies; 104+ messages in thread
From: Yury Norov @ 2018-10-13 13:43 UTC (permalink / raw)
  To: Catalin Marinas
  Cc: Eugene Syromiatnikov, linux-doc, Szabolcs Nagy, Palmer Dabbelt,
	Heiko Carstens, Pavel Machek, Philipp Tomsich, Joseph Myers,
	linux-arch, Ellcey, Steve, Kapoor, Prasun, Andreas Schwab,
	Alexander Graf, Bamvor Zhangjian, Geert Uytterhoeven,
	Dave Martin, Adam Borowski, Manuel Montezelo, James Hogan,
	Chris Metcalf, Arnd Bergmann, Andrew Pinski, Lin Yongting,
	Alexey Klimov, Wookey, Mark Brown, linux-arm-kernel,
	Maxim Kuvyrkov, Florian Weimer, linux-api, Nathan_Lynch,
	linux-kernel, James Morse, Ramana Radhakrishnan,
	Martin Schwidefsky, David S . Miller, Christoph Muellner

On Sat, Oct 13, 2018 at 10:34:11AM +0100, Catalin Marinas wrote:
> 
> Lines: 73
> 
> External Email
> 
> On Sat, Oct 13, 2018 at 04:14:16AM +0200, Eugene Syromiatnikov wrote:
> > On Wed, Oct 10, 2018 at 04:36:56PM +0100, Catalin Marinas wrote:
> > > On Wed, Oct 10, 2018 at 04:10:21PM +0200, Eugene Syromiatnikov wrote:
> > > > I have some questions regarding AArch64 ILP32 implementation for which I
> > > > failed to find an answer myself:
> > > >  * How ptrace() tracer is supposed to distinguish between ILP32 and LP64
> > > >    tracees? For MIPS N32 and x32 this is possible based on syscall
> > > >    number, but for AArch64 ILP32 I do not see such a sign. There's also
> > > >    ARM_ip is employed for signalling entering/exiting, I wonder whether
> > > >    it's possible to employ it also for signalling tracee's personality.
> > >
> > > With the current implementation, I don't think you can distinguish. From
> > > the kernel perspective, the register set is the same. What is the
> > > use-case for this?
> >
> > Err, a ptrace()-based tracer trying to trace a process, for example?
> 
> I first thought it wouldn't matter for ptrace-based tracers since the
> syscall numbers are (mostly) the same. But the arguments layout in
> register is indeed different, so I see your point now about having to
> distinguish.
> 
> > > We could add a new regset to expose the ILP32 state (NT_ARM_..., I can't
> > > think of a name now but probably not PER* as this implies PER_LINUX_...
> > > which is independent from TIF_32BIT_*).
> >
> > So that would require an additional ptrace() call on each syscall stop,
> > is that correct?
> 
> The ILP32 state does not change at run-time, so it could only do a
> ptrace() call once and save the information. No need to re-read it on
> each syscall stop.
> 
> We could set a high bit in the syscall number reported to the ptrace
> caller (though not changing the syscall ABI) but I haven't thought of
> other consequences. For example, can the ptrace caller change the
> syscall number?

I believe, /proc/PID/auxv is enough to distinguish between arm64, ilp32
and aarch32 ABis. If no, I think it's better to do it there.

I don't have ILP32 machine available at the moment, but I'll check it soon. 

> > > >  * What's the reasoning behind capping syscall arguments to 32 bit? x32
> > > >    and MIPS N32 do not have such a restriction (and do not need special
> > > >    wrappers for syscalls that pass 64-bit values as a result, except
> > > >    when they do,  as it is the case for preadv2 on x32); moreover, that
> > > >    would lead to insurmountable difficulties for AArch64 ILP32 tracers
> > > >    that try to trace LP64 tracees, as it would be impossible to pass
> > > >    64-bit addresses to process_vm_{read,write} or ptrace PEEK/POKE.
> > >
> > > We've attempted in earlier versions to allow a mix of 32 and 64-bit
> > > register values from ILP32 but it got pretty complicated. The entry code
> > > would need to know which registers need zeroing of the top 32-bit
> >
> > If kernel specifies 64-bit wide registers for syscalls, then it's the
> > caller's (libc's) responsibility to properly sign-extend arguments when
> > needed, and glibc, for example, already has proper type definitions that
> > aimed to handle this.
> 
> We tried, see my other reply.

A couple of links to recall the story:
https://www.spinics.net/lists/linux-s390/msg11593.html
http://linux-kernel.2935.n7.nabble.com/RFC6-PATCH-v6-00-21-ILP32-for-ARM64-td1345105.html

Cover-letter of the series has links to previous discussions.

I would also notice that even if we pass 64-bit parameters in a single
register, we cannot avoid using the compat layer. It looks more natural
not to split the 64-bit register, but from performance point of view
there is almost no difference, either we split registers or not (2.6%
for empty syscall, as I measured). And the cost of overcomplication was
considered too much. So we chose to stick to more standard compat layer
and gain in maintainability. 

Yury

^ permalink raw reply	[flat|nested] 104+ messages in thread

* [PATCH v9 00/24] ILP32 for ARM64
@ 2018-10-13 13:43             ` Yury Norov
  0 siblings, 0 replies; 104+ messages in thread
From: Yury Norov @ 2018-10-13 13:43 UTC (permalink / raw)
  To: linux-arm-kernel

On Sat, Oct 13, 2018 at 10:34:11AM +0100, Catalin Marinas wrote:
> 
> Lines: 73
> 
> External Email
> 
> On Sat, Oct 13, 2018 at 04:14:16AM +0200, Eugene Syromiatnikov wrote:
> > On Wed, Oct 10, 2018 at 04:36:56PM +0100, Catalin Marinas wrote:
> > > On Wed, Oct 10, 2018 at 04:10:21PM +0200, Eugene Syromiatnikov wrote:
> > > > I have some questions regarding AArch64 ILP32 implementation for which I
> > > > failed to find an answer myself:
> > > >  * How ptrace() tracer is supposed to distinguish between ILP32 and LP64
> > > >    tracees? For MIPS N32 and x32 this is possible based on syscall
> > > >    number, but for AArch64 ILP32 I do not see such a sign. There's also
> > > >    ARM_ip is employed for signalling entering/exiting, I wonder whether
> > > >    it's possible to employ it also for signalling tracee's personality.
> > >
> > > With the current implementation, I don't think you can distinguish. From
> > > the kernel perspective, the register set is the same. What is the
> > > use-case for this?
> >
> > Err, a ptrace()-based tracer trying to trace a process, for example?
> 
> I first thought it wouldn't matter for ptrace-based tracers since the
> syscall numbers are (mostly) the same. But the arguments layout in
> register is indeed different, so I see your point now about having to
> distinguish.
> 
> > > We could add a new regset to expose the ILP32 state (NT_ARM_..., I can't
> > > think of a name now but probably not PER* as this implies PER_LINUX_...
> > > which is independent from TIF_32BIT_*).
> >
> > So that would require an additional ptrace() call on each syscall stop,
> > is that correct?
> 
> The ILP32 state does not change at run-time, so it could only do a
> ptrace() call once and save the information. No need to re-read it on
> each syscall stop.
> 
> We could set a high bit in the syscall number reported to the ptrace
> caller (though not changing the syscall ABI) but I haven't thought of
> other consequences. For example, can the ptrace caller change the
> syscall number?

I believe, /proc/PID/auxv is enough to distinguish between arm64, ilp32
and aarch32 ABis. If no, I think it's better to do it there.

I don't have ILP32 machine available at the moment, but I'll check it soon. 

> > > >  * What's the reasoning behind capping syscall arguments to 32 bit? x32
> > > >    and MIPS N32 do not have such a restriction (and do not need special
> > > >    wrappers for syscalls that pass 64-bit values as a result, except
> > > >    when they do,  as it is the case for preadv2 on x32); moreover, that
> > > >    would lead to insurmountable difficulties for AArch64 ILP32 tracers
> > > >    that try to trace LP64 tracees, as it would be impossible to pass
> > > >    64-bit addresses to process_vm_{read,write} or ptrace PEEK/POKE.
> > >
> > > We've attempted in earlier versions to allow a mix of 32 and 64-bit
> > > register values from ILP32 but it got pretty complicated. The entry code
> > > would need to know which registers need zeroing of the top 32-bit
> >
> > If kernel specifies 64-bit wide registers for syscalls, then it's the
> > caller's (libc's) responsibility to properly sign-extend arguments when
> > needed, and glibc, for example, already has proper type definitions that
> > aimed to handle this.
> 
> We tried, see my other reply.

A couple of links to recall the story:
https://www.spinics.net/lists/linux-s390/msg11593.html
http://linux-kernel.2935.n7.nabble.com/RFC6-PATCH-v6-00-21-ILP32-for-ARM64-td1345105.html

Cover-letter of the series has links to previous discussions.

I would also notice that even if we pass 64-bit parameters in a single
register, we cannot avoid using the compat layer. It looks more natural
not to split the 64-bit register, but from performance point of view
there is almost no difference, either we split registers or not (2.6%
for empty syscall, as I measured). And the cost of overcomplication was
considered too much. So we chose to stick to more standard compat layer
and gain in maintainability. 

Yury

^ permalink raw reply	[flat|nested] 104+ messages in thread

* Re: [PATCH v9 00/24] ILP32 for ARM64
  2018-10-13  2:14         ` Eugene Syromiatnikov
  (?)
@ 2018-10-13  9:34           ` Catalin Marinas
  -1 siblings, 0 replies; 104+ messages in thread
From: Catalin Marinas @ 2018-10-13  9:34 UTC (permalink / raw)
  To: Eugene Syromiatnikov
  Cc: linux-doc, Szabolcs Nagy, Palmer Dabbelt, Heiko Carstens,
	Yury Norov, Pavel Machek, Philipp Tomsich, Joseph Myers,
	linux-arch, Steve Ellcey, Prasun Kapoor, Andreas Schwab,
	Alexander Graf, Bamvor Zhangjian, Geert Uytterhoeven,
	Dave Martin, Adam Borowski, Manuel Montezelo, James Hogan,
	Chris Metcalf, Arnd Bergmann, Andrew Pinski, Lin Yongting,
	Alexey Klimov, Wookey, Mark Brown, linux-arm-kernel,
	Maxim Kuvyrkov, Florian Weimer, linux-api, Nathan_Lynch,
	linux-kernel, James Morse, Ramana Radhakrishnan,
	Martin Schwidefsky, David S . Miller, Christoph Muellner

On Sat, Oct 13, 2018 at 04:14:16AM +0200, Eugene Syromiatnikov wrote:
> On Wed, Oct 10, 2018 at 04:36:56PM +0100, Catalin Marinas wrote:
> > On Wed, Oct 10, 2018 at 04:10:21PM +0200, Eugene Syromiatnikov wrote:
> > > I have some questions regarding AArch64 ILP32 implementation for which I
> > > failed to find an answer myself:
> > >  * How ptrace() tracer is supposed to distinguish between ILP32 and LP64
> > >    tracees? For MIPS N32 and x32 this is possible based on syscall
> > >    number, but for AArch64 ILP32 I do not see such a sign. There's also
> > >    ARM_ip is employed for signalling entering/exiting, I wonder whether
> > >    it's possible to employ it also for signalling tracee's personality.
> > 
> > With the current implementation, I don't think you can distinguish. From
> > the kernel perspective, the register set is the same. What is the
> > use-case for this?
> 
> Err, a ptrace()-based tracer trying to trace a process, for example?

I first thought it wouldn't matter for ptrace-based tracers since the
syscall numbers are (mostly) the same. But the arguments layout in
register is indeed different, so I see your point now about having to
distinguish.

> > We could add a new regset to expose the ILP32 state (NT_ARM_..., I can't
> > think of a name now but probably not PER* as this implies PER_LINUX_...
> > which is independent from TIF_32BIT_*).
> 
> So that would require an additional ptrace() call on each syscall stop,
> is that correct?

The ILP32 state does not change at run-time, so it could only do a
ptrace() call once and save the information. No need to re-read it on
each syscall stop.

We could set a high bit in the syscall number reported to the ptrace
caller (though not changing the syscall ABI) but I haven't thought of
other consequences. For example, can the ptrace caller change the
syscall number?

> > >  * What's the reasoning behind capping syscall arguments to 32 bit? x32
> > >    and MIPS N32 do not have such a restriction (and do not need special
> > >    wrappers for syscalls that pass 64-bit values as a result, except
> > >    when they do,  as it is the case for preadv2 on x32); moreover, that
> > >    would lead to insurmountable difficulties for AArch64 ILP32 tracers
> > >    that try to trace LP64 tracees, as it would be impossible to pass
> > >    64-bit addresses to process_vm_{read,write} or ptrace PEEK/POKE.
> > 
> > We've attempted in earlier versions to allow a mix of 32 and 64-bit
> > register values from ILP32 but it got pretty complicated. The entry code
> > would need to know which registers need zeroing of the top 32-bit
> 
> If kernel specifies 64-bit wide registers for syscalls, then it's the
> caller's (libc's) responsibility to properly sign-extend arguments when
> needed, and glibc, for example, already has proper type definitions that
> aimed to handle this.

We tried, see my other reply.

-- 
Catalin

^ permalink raw reply	[flat|nested] 104+ messages in thread

* Re: [PATCH v9 00/24] ILP32 for ARM64
@ 2018-10-13  9:34           ` Catalin Marinas
  0 siblings, 0 replies; 104+ messages in thread
From: Catalin Marinas @ 2018-10-13  9:34 UTC (permalink / raw)
  To: Eugene Syromiatnikov
  Cc: linux-doc, Szabolcs Nagy, Palmer Dabbelt, Heiko Carstens,
	Yury Norov, Pavel Machek, Philipp Tomsich, Joseph Myers,
	linux-arch, Steve Ellcey, Prasun Kapoor, Andreas Schwab,
	Alexander Graf, Bamvor Zhangjian, Geert Uytterhoeven,
	Dave Martin, Adam Borowski, Manuel Montezelo, James Hogan,
	Chris Metcalf, Arnd Bergmann, Andrew Pinski, Lin Yongting

On Sat, Oct 13, 2018 at 04:14:16AM +0200, Eugene Syromiatnikov wrote:
> On Wed, Oct 10, 2018 at 04:36:56PM +0100, Catalin Marinas wrote:
> > On Wed, Oct 10, 2018 at 04:10:21PM +0200, Eugene Syromiatnikov wrote:
> > > I have some questions regarding AArch64 ILP32 implementation for which I
> > > failed to find an answer myself:
> > >  * How ptrace() tracer is supposed to distinguish between ILP32 and LP64
> > >    tracees? For MIPS N32 and x32 this is possible based on syscall
> > >    number, but for AArch64 ILP32 I do not see such a sign. There's also
> > >    ARM_ip is employed for signalling entering/exiting, I wonder whether
> > >    it's possible to employ it also for signalling tracee's personality.
> > 
> > With the current implementation, I don't think you can distinguish. From
> > the kernel perspective, the register set is the same. What is the
> > use-case for this?
> 
> Err, a ptrace()-based tracer trying to trace a process, for example?

I first thought it wouldn't matter for ptrace-based tracers since the
syscall numbers are (mostly) the same. But the arguments layout in
register is indeed different, so I see your point now about having to
distinguish.

> > We could add a new regset to expose the ILP32 state (NT_ARM_..., I can't
> > think of a name now but probably not PER* as this implies PER_LINUX_...
> > which is independent from TIF_32BIT_*).
> 
> So that would require an additional ptrace() call on each syscall stop,
> is that correct?

The ILP32 state does not change at run-time, so it could only do a
ptrace() call once and save the information. No need to re-read it on
each syscall stop.

We could set a high bit in the syscall number reported to the ptrace
caller (though not changing the syscall ABI) but I haven't thought of
other consequences. For example, can the ptrace caller change the
syscall number?

> > >  * What's the reasoning behind capping syscall arguments to 32 bit? x32
> > >    and MIPS N32 do not have such a restriction (and do not need special
> > >    wrappers for syscalls that pass 64-bit values as a result, except
> > >    when they do,  as it is the case for preadv2 on x32); moreover, that
> > >    would lead to insurmountable difficulties for AArch64 ILP32 tracers
> > >    that try to trace LP64 tracees, as it would be impossible to pass
> > >    64-bit addresses to process_vm_{read,write} or ptrace PEEK/POKE.
> > 
> > We've attempted in earlier versions to allow a mix of 32 and 64-bit
> > register values from ILP32 but it got pretty complicated. The entry code
> > would need to know which registers need zeroing of the top 32-bit
> 
> If kernel specifies 64-bit wide registers for syscalls, then it's the
> caller's (libc's) responsibility to properly sign-extend arguments when
> needed, and glibc, for example, already has proper type definitions that
> aimed to handle this.

We tried, see my other reply.

-- 
Catalin

^ permalink raw reply	[flat|nested] 104+ messages in thread

* [PATCH v9 00/24] ILP32 for ARM64
@ 2018-10-13  9:34           ` Catalin Marinas
  0 siblings, 0 replies; 104+ messages in thread
From: Catalin Marinas @ 2018-10-13  9:34 UTC (permalink / raw)
  To: linux-arm-kernel

On Sat, Oct 13, 2018 at 04:14:16AM +0200, Eugene Syromiatnikov wrote:
> On Wed, Oct 10, 2018 at 04:36:56PM +0100, Catalin Marinas wrote:
> > On Wed, Oct 10, 2018 at 04:10:21PM +0200, Eugene Syromiatnikov wrote:
> > > I have some questions regarding AArch64 ILP32 implementation for which I
> > > failed to find an answer myself:
> > >  * How ptrace() tracer is supposed to distinguish between ILP32 and LP64
> > >    tracees? For MIPS N32 and x32 this is possible based on syscall
> > >    number, but for AArch64 ILP32 I do not see such a sign. There's also
> > >    ARM_ip is employed for signalling entering/exiting, I wonder whether
> > >    it's possible to employ it also for signalling tracee's personality.
> > 
> > With the current implementation, I don't think you can distinguish. From
> > the kernel perspective, the register set is the same. What is the
> > use-case for this?
> 
> Err, a ptrace()-based tracer trying to trace a process, for example?

I first thought it wouldn't matter for ptrace-based tracers since the
syscall numbers are (mostly) the same. But the arguments layout in
register is indeed different, so I see your point now about having to
distinguish.

> > We could add a new regset to expose the ILP32 state (NT_ARM_..., I can't
> > think of a name now but probably not PER* as this implies PER_LINUX_...
> > which is independent from TIF_32BIT_*).
> 
> So that would require an additional ptrace() call on each syscall stop,
> is that correct?

The ILP32 state does not change at run-time, so it could only do a
ptrace() call once and save the information. No need to re-read it on
each syscall stop.

We could set a high bit in the syscall number reported to the ptrace
caller (though not changing the syscall ABI) but I haven't thought of
other consequences. For example, can the ptrace caller change the
syscall number?

> > >  * What's the reasoning behind capping syscall arguments to 32 bit? x32
> > >    and MIPS N32 do not have such a restriction (and do not need special
> > >    wrappers for syscalls that pass 64-bit values as a result, except
> > >    when they do,  as it is the case for preadv2 on x32); moreover, that
> > >    would lead to insurmountable difficulties for AArch64 ILP32 tracers
> > >    that try to trace LP64 tracees, as it would be impossible to pass
> > >    64-bit addresses to process_vm_{read,write} or ptrace PEEK/POKE.
> > 
> > We've attempted in earlier versions to allow a mix of 32 and 64-bit
> > register values from ILP32 but it got pretty complicated. The entry code
> > would need to know which registers need zeroing of the top 32-bit
> 
> If kernel specifies 64-bit wide registers for syscalls, then it's the
> caller's (libc's) responsibility to properly sign-extend arguments when
> needed, and glibc, for example, already has proper type definitions that
> aimed to handle this.

We tried, see my other reply.

-- 
Catalin

^ permalink raw reply	[flat|nested] 104+ messages in thread

* Re: [PATCH v9 00/24] ILP32 for ARM64
  2018-10-13  2:07         ` Eugene Syromiatnikov
  (?)
@ 2018-10-13  9:20           ` Catalin Marinas
  -1 siblings, 0 replies; 104+ messages in thread
From: Catalin Marinas @ 2018-10-13  9:20 UTC (permalink / raw)
  To: Eugene Syromiatnikov
  Cc: Szabolcs Nagy, linux-doc, Palmer Dabbelt, Heiko Carstens,
	Yury Norov, Pavel Machek, Philipp Tomsich, Joseph Myers,
	linux-arch, Steve Ellcey, Prasun Kapoor, Andreas Schwab,
	Alexander Graf, Geert Uytterhoeven, Bamvor Zhangjian,
	Dave Martin, Adam Borowski, Manuel Montezelo, James Hogan,
	Chris Metcalf, Arnd Bergmann, Andrew Pinski, Lin Yongting,
	Alexey Klimov, Wookey, Mark Brown, nd, linux-arm-kernel,
	Maxim Kuvyrkov, Florian Weimer, linux-api, Nathan_Lynch,
	linux-kernel, James Morse, Ramana Radhakrishnan,
	Martin Schwidefsky, David S . Miller, Christoph Muellner

On Sat, Oct 13, 2018 at 04:07:31AM +0200, Eugene Syromiatnikov wrote:
> On Wed, Oct 10, 2018 at 03:39:07PM +0100, Szabolcs Nagy wrote:
> > On 10/10/18 15:10, Eugene Syromiatnikov wrote:
> > >  * What's the reasoning behind capping syscall arguments to 32 bit? x32
> > >    and MIPS N32 do not have such a restriction (and do not need special
> > >    wrappers for syscalls that pass 64-bit values as a result, except
> > >    when they do,  as it is the case for preadv2 on x32); moreover, that
> > >    would lead to insurmountable difficulties for AArch64 ILP32 tracers
> > >    that try to trace LP64 tracees, as it would be impossible to pass
> > >    64-bit addresses to process_vm_{read,write} or ptrace PEEK/POKE.
> > 
> > but that's necessarily the case for all ilp32 abis:
> > the userspace syscall function receives 32bit
> > arguments so even if the kernel abi takes 64bit
> > args you cannot use that from c code. (the libc
> > does not even know which args should be sign or
> > zero extended.)
> 
> glibc's syscall() prototype has kernel_ulong_t as its arguments (more
> specifically, to __syscall_ulong_t, which is 64-bit wide on x32; it
> should also have kernel_long_t as its return type instead of long,
> but that's another story), so it works perfectly fine in case of x32.

This would have been my preferred approach but the libc community were
not entirely happy with it as it breaks POSIX compatibility:

https://sourceware.org/bugzilla/show_bug.cgi?id=16437
http://lists.infradead.org/pipermail/linux-arm-kernel/2015-February/323348.html

(there are other threads around x32 and people arguing whether POSIX is
wrong)

Some sometime around version 4 or 5 of this series, we made the move
(back) to compat-like ABI.

-- 
Catalin

^ permalink raw reply	[flat|nested] 104+ messages in thread

* Re: [PATCH v9 00/24] ILP32 for ARM64
@ 2018-10-13  9:20           ` Catalin Marinas
  0 siblings, 0 replies; 104+ messages in thread
From: Catalin Marinas @ 2018-10-13  9:20 UTC (permalink / raw)
  To: Eugene Syromiatnikov
  Cc: Szabolcs Nagy, linux-doc, Palmer Dabbelt, Heiko Carstens,
	Yury Norov, Pavel Machek, Philipp Tomsich, Joseph Myers,
	linux-arch, Steve Ellcey, Prasun Kapoor, Andreas Schwab,
	Alexander Graf, Geert Uytterhoeven, Bamvor Zhangjian,
	Dave Martin, Adam Borowski, Manuel Montezelo, James Hogan

On Sat, Oct 13, 2018 at 04:07:31AM +0200, Eugene Syromiatnikov wrote:
> On Wed, Oct 10, 2018 at 03:39:07PM +0100, Szabolcs Nagy wrote:
> > On 10/10/18 15:10, Eugene Syromiatnikov wrote:
> > >  * What's the reasoning behind capping syscall arguments to 32 bit? x32
> > >    and MIPS N32 do not have such a restriction (and do not need special
> > >    wrappers for syscalls that pass 64-bit values as a result, except
> > >    when they do,  as it is the case for preadv2 on x32); moreover, that
> > >    would lead to insurmountable difficulties for AArch64 ILP32 tracers
> > >    that try to trace LP64 tracees, as it would be impossible to pass
> > >    64-bit addresses to process_vm_{read,write} or ptrace PEEK/POKE.
> > 
> > but that's necessarily the case for all ilp32 abis:
> > the userspace syscall function receives 32bit
> > arguments so even if the kernel abi takes 64bit
> > args you cannot use that from c code. (the libc
> > does not even know which args should be sign or
> > zero extended.)
> 
> glibc's syscall() prototype has kernel_ulong_t as its arguments (more
> specifically, to __syscall_ulong_t, which is 64-bit wide on x32; it
> should also have kernel_long_t as its return type instead of long,
> but that's another story), so it works perfectly fine in case of x32.

This would have been my preferred approach but the libc community were
not entirely happy with it as it breaks POSIX compatibility:

https://sourceware.org/bugzilla/show_bug.cgi?id=16437
http://lists.infradead.org/pipermail/linux-arm-kernel/2015-February/323348.html

(there are other threads around x32 and people arguing whether POSIX is
wrong)

Some sometime around version 4 or 5 of this series, we made the move
(back) to compat-like ABI.

-- 
Catalin

^ permalink raw reply	[flat|nested] 104+ messages in thread

* [PATCH v9 00/24] ILP32 for ARM64
@ 2018-10-13  9:20           ` Catalin Marinas
  0 siblings, 0 replies; 104+ messages in thread
From: Catalin Marinas @ 2018-10-13  9:20 UTC (permalink / raw)
  To: linux-arm-kernel

On Sat, Oct 13, 2018 at 04:07:31AM +0200, Eugene Syromiatnikov wrote:
> On Wed, Oct 10, 2018 at 03:39:07PM +0100, Szabolcs Nagy wrote:
> > On 10/10/18 15:10, Eugene Syromiatnikov wrote:
> > >  * What's the reasoning behind capping syscall arguments to 32 bit? x32
> > >    and MIPS N32 do not have such a restriction (and do not need special
> > >    wrappers for syscalls that pass 64-bit values as a result, except
> > >    when they do,  as it is the case for preadv2 on x32); moreover, that
> > >    would lead to insurmountable difficulties for AArch64 ILP32 tracers
> > >    that try to trace LP64 tracees, as it would be impossible to pass
> > >    64-bit addresses to process_vm_{read,write} or ptrace PEEK/POKE.
> > 
> > but that's necessarily the case for all ilp32 abis:
> > the userspace syscall function receives 32bit
> > arguments so even if the kernel abi takes 64bit
> > args you cannot use that from c code. (the libc
> > does not even know which args should be sign or
> > zero extended.)
> 
> glibc's syscall() prototype has kernel_ulong_t as its arguments (more
> specifically, to __syscall_ulong_t, which is 64-bit wide on x32; it
> should also have kernel_long_t as its return type instead of long,
> but that's another story), so it works perfectly fine in case of x32.

This would have been my preferred approach but the libc community were
not entirely happy with it as it breaks POSIX compatibility:

https://sourceware.org/bugzilla/show_bug.cgi?id=16437
http://lists.infradead.org/pipermail/linux-arm-kernel/2015-February/323348.html

(there are other threads around x32 and people arguing whether POSIX is
wrong)

Some sometime around version 4 or 5 of this series, we made the move
(back) to compat-like ABI.

-- 
Catalin

^ permalink raw reply	[flat|nested] 104+ messages in thread

* Re: [PATCH v9 00/24] ILP32 for ARM64
  2018-10-10 15:36       ` Catalin Marinas
  (?)
@ 2018-10-13  2:14         ` Eugene Syromiatnikov
  -1 siblings, 0 replies; 104+ messages in thread
From: Eugene Syromiatnikov @ 2018-10-13  2:14 UTC (permalink / raw)
  To: Catalin Marinas
  Cc: Yury Norov, Arnd Bergmann, linux-arm-kernel, linux-kernel,
	linux-doc, linux-arch, linux-api, Adam Borowski, Alexander Graf,
	Alexey Klimov, Andreas Schwab, Andrew Pinski, Bamvor Zhangjian,
	Chris Metcalf, Christoph Muellner, Dave Martin, David S . Miller,
	Florian Weimer, Geert Uytterhoeven, Heiko Carstens, James Hogan,
	James Morse, Joseph Myers, Lin Yongting, Manuel Montezelo,
	Mark Brown, Martin Schwidefsky, Maxim Kuvyrkov, Nathan_Lynch,
	Philipp Tomsich, Prasun Kapoor, Ramana Radhakrishnan,
	Steve Ellcey, Szabolcs Nagy, Pavel Machek, Palmer Dabbelt,
	Wookey

On Wed, Oct 10, 2018 at 04:36:56PM +0100, Catalin Marinas wrote:
> On Wed, Oct 10, 2018 at 04:10:21PM +0200, Eugene Syromiatnikov wrote:
> > I have some questions regarding AArch64 ILP32 implementation for which I
> > failed to find an answer myself:
> >  * How ptrace() tracer is supposed to distinguish between ILP32 and LP64
> >    tracees? For MIPS N32 and x32 this is possible based on syscall
> >    number, but for AArch64 ILP32 I do not see such a sign. There's also
> >    ARM_ip is employed for signalling entering/exiting, I wonder whether
> >    it's possible to employ it also for signalling tracee's personality.
> 
> With the current implementation, I don't think you can distinguish. From
> the kernel perspective, the register set is the same. What is the
> use-case for this?

Err, a ptrace()-based tracer trying to trace a process, for example?

> We could add a new regset to expose the ILP32 state (NT_ARM_..., I can't
> think of a name now but probably not PER* as this implies PER_LINUX_...
> which is independent from TIF_32BIT_*).

So that would require an additional ptrace() call on each syscall stop,
is that correct?

> >  * What's the reasoning behind capping syscall arguments to 32 bit? x32
> >    and MIPS N32 do not have such a restriction (and do not need special
> >    wrappers for syscalls that pass 64-bit values as a result, except
> >    when they do,  as it is the case for preadv2 on x32); moreover, that
> >    would lead to insurmountable difficulties for AArch64 ILP32 tracers
> >    that try to trace LP64 tracees, as it would be impossible to pass
> >    64-bit addresses to process_vm_{read,write} or ptrace PEEK/POKE.
> 
> We've attempted in earlier versions to allow a mix of 32 and 64-bit
> register values from ILP32 but it got pretty complicated. The entry code
> would need to know which registers need zeroing of the top 32-bit

If kernel specifies 64-bit wide registers for syscalls, then it's the
caller's (libc's) responsibility to properly sign-extend arguments when
needed, and glibc, for example, already has proper type definitions that
aimed to handle this.

> and the generic unistd.h wrapper hacks were not very nice.

They are already implemented in glibc during x32 introduction period.

> Some past discussions:
> 
> https://www.mail-archive.com/linux-kernel@vger.kernel.org/msg1211716.html
> 
> -- 
> Catalin

^ permalink raw reply	[flat|nested] 104+ messages in thread

* Re: [PATCH v9 00/24] ILP32 for ARM64
@ 2018-10-13  2:14         ` Eugene Syromiatnikov
  0 siblings, 0 replies; 104+ messages in thread
From: Eugene Syromiatnikov @ 2018-10-13  2:14 UTC (permalink / raw)
  To: Catalin Marinas
  Cc: Yury Norov, Arnd Bergmann, linux-arm-kernel, linux-kernel,
	linux-doc, linux-arch, linux-api, Adam Borowski, Alexander Graf,
	Alexey Klimov, Andreas Schwab, Andrew Pinski, Bamvor Zhangjian,
	Chris Metcalf, Christoph Muellner, Dave Martin, David S . Miller,
	Florian Weimer, Geert Uytterhoeven, Heiko Carstens, James Hogan

On Wed, Oct 10, 2018 at 04:36:56PM +0100, Catalin Marinas wrote:
> On Wed, Oct 10, 2018 at 04:10:21PM +0200, Eugene Syromiatnikov wrote:
> > I have some questions regarding AArch64 ILP32 implementation for which I
> > failed to find an answer myself:
> >  * How ptrace() tracer is supposed to distinguish between ILP32 and LP64
> >    tracees? For MIPS N32 and x32 this is possible based on syscall
> >    number, but for AArch64 ILP32 I do not see such a sign. There's also
> >    ARM_ip is employed for signalling entering/exiting, I wonder whether
> >    it's possible to employ it also for signalling tracee's personality.
> 
> With the current implementation, I don't think you can distinguish. From
> the kernel perspective, the register set is the same. What is the
> use-case for this?

Err, a ptrace()-based tracer trying to trace a process, for example?

> We could add a new regset to expose the ILP32 state (NT_ARM_..., I can't
> think of a name now but probably not PER* as this implies PER_LINUX_...
> which is independent from TIF_32BIT_*).

So that would require an additional ptrace() call on each syscall stop,
is that correct?

> >  * What's the reasoning behind capping syscall arguments to 32 bit? x32
> >    and MIPS N32 do not have such a restriction (and do not need special
> >    wrappers for syscalls that pass 64-bit values as a result, except
> >    when they do,  as it is the case for preadv2 on x32); moreover, that
> >    would lead to insurmountable difficulties for AArch64 ILP32 tracers
> >    that try to trace LP64 tracees, as it would be impossible to pass
> >    64-bit addresses to process_vm_{read,write} or ptrace PEEK/POKE.
> 
> We've attempted in earlier versions to allow a mix of 32 and 64-bit
> register values from ILP32 but it got pretty complicated. The entry code
> would need to know which registers need zeroing of the top 32-bit

If kernel specifies 64-bit wide registers for syscalls, then it's the
caller's (libc's) responsibility to properly sign-extend arguments when
needed, and glibc, for example, already has proper type definitions that
aimed to handle this.

> and the generic unistd.h wrapper hacks were not very nice.

They are already implemented in glibc during x32 introduction period.

> Some past discussions:
> 
> https://www.mail-archive.com/linux-kernel@vger.kernel.org/msg1211716.html
> 
> -- 
> Catalin

^ permalink raw reply	[flat|nested] 104+ messages in thread

* [PATCH v9 00/24] ILP32 for ARM64
@ 2018-10-13  2:14         ` Eugene Syromiatnikov
  0 siblings, 0 replies; 104+ messages in thread
From: Eugene Syromiatnikov @ 2018-10-13  2:14 UTC (permalink / raw)
  To: linux-arm-kernel

On Wed, Oct 10, 2018 at 04:36:56PM +0100, Catalin Marinas wrote:
> On Wed, Oct 10, 2018 at 04:10:21PM +0200, Eugene Syromiatnikov wrote:
> > I have some questions regarding AArch64 ILP32 implementation for which I
> > failed to find an answer myself:
> >  * How ptrace() tracer is supposed to distinguish between ILP32 and LP64
> >    tracees? For MIPS N32 and x32 this is possible based on syscall
> >    number, but for AArch64 ILP32 I do not see such a sign. There's also
> >    ARM_ip is employed for signalling entering/exiting, I wonder whether
> >    it's possible to employ it also for signalling tracee's personality.
> 
> With the current implementation, I don't think you can distinguish. From
> the kernel perspective, the register set is the same. What is the
> use-case for this?

Err, a ptrace()-based tracer trying to trace a process, for example?

> We could add a new regset to expose the ILP32 state (NT_ARM_..., I can't
> think of a name now but probably not PER* as this implies PER_LINUX_...
> which is independent from TIF_32BIT_*).

So that would require an additional ptrace() call on each syscall stop,
is that correct?

> >  * What's the reasoning behind capping syscall arguments to 32 bit? x32
> >    and MIPS N32 do not have such a restriction (and do not need special
> >    wrappers for syscalls that pass 64-bit values as a result, except
> >    when they do,  as it is the case for preadv2 on x32); moreover, that
> >    would lead to insurmountable difficulties for AArch64 ILP32 tracers
> >    that try to trace LP64 tracees, as it would be impossible to pass
> >    64-bit addresses to process_vm_{read,write} or ptrace PEEK/POKE.
> 
> We've attempted in earlier versions to allow a mix of 32 and 64-bit
> register values from ILP32 but it got pretty complicated. The entry code
> would need to know which registers need zeroing of the top 32-bit

If kernel specifies 64-bit wide registers for syscalls, then it's the
caller's (libc's) responsibility to properly sign-extend arguments when
needed, and glibc, for example, already has proper type definitions that
aimed to handle this.

> and the generic unistd.h wrapper hacks were not very nice.

They are already implemented in glibc during x32 introduction period.

> Some past discussions:
> 
> https://www.mail-archive.com/linux-kernel at vger.kernel.org/msg1211716.html
> 
> -- 
> Catalin

^ permalink raw reply	[flat|nested] 104+ messages in thread

* Re: [PATCH v9 00/24] ILP32 for ARM64
  2018-10-10 14:39       ` Szabolcs Nagy
  (?)
@ 2018-10-13  2:07         ` Eugene Syromiatnikov
  -1 siblings, 0 replies; 104+ messages in thread
From: Eugene Syromiatnikov @ 2018-10-13  2:07 UTC (permalink / raw)
  To: Szabolcs Nagy
  Cc: Yury Norov, nd, Catalin Marinas, Arnd Bergmann, linux-arm-kernel,
	linux-kernel, linux-doc, linux-arch, linux-api, Adam Borowski,
	Alexander Graf, Alexey Klimov, Andreas Schwab, Andrew Pinski,
	Bamvor Zhangjian, Chris Metcalf, Christoph Muellner, Dave Martin,
	David S . Miller, Florian Weimer, Geert Uytterhoeven,
	Heiko Carstens, James Hogan, James Morse, Joseph Myers,
	Lin Yongting, Manuel Montezelo, Mark Brown, Martin Schwidefsky,
	Maxim Kuvyrkov, Nathan_Lynch, Philipp Tomsich, Prasun Kapoor,
	Ramana Radhakrishnan, Steve Ellcey, Pavel Machek, Palmer Dabbelt,
	Wookey

On Wed, Oct 10, 2018 at 03:39:07PM +0100, Szabolcs Nagy wrote:
> On 10/10/18 15:10, Eugene Syromiatnikov wrote:
> >  * What's the reasoning behind capping syscall arguments to 32 bit? x32
> >    and MIPS N32 do not have such a restriction (and do not need special
> >    wrappers for syscalls that pass 64-bit values as a result, except
> >    when they do,  as it is the case for preadv2 on x32); moreover, that
> >    would lead to insurmountable difficulties for AArch64 ILP32 tracers
> >    that try to trace LP64 tracees, as it would be impossible to pass
> >    64-bit addresses to process_vm_{read,write} or ptrace PEEK/POKE.
> 
> but that's necessarily the case for all ilp32 abis:
> the userspace syscall function receives 32bit
> arguments so even if the kernel abi takes 64bit
> args you cannot use that from c code. (the libc
> does not even know which args should be sign or
> zero extended.)

glibc's syscall() prototype has kernel_ulong_t as its arguments (more
specifically, to __syscall_ulong_t, which is 64-bit wide on x32; it
should also have kernel_long_t as its return type instead of long,
but that's another story), so it works perfectly fine in case of x32.

> process_vm_readv/writev is limited by the ilp32
> iovec struct, not by the syscall arguments.

Right, on x32/N32 this issue is worked around by the usage of the respective
x86_64/N64 call, and it looks like another thing that is impossible
with AArch64 ilp32.

> ptrace is specified to take void* addr argument,
> and void* is 32bit on all ilp32 targets.
> so again on the c language level there is no
> way around the 32bit limitation.

Which is an issue.

^ permalink raw reply	[flat|nested] 104+ messages in thread

* Re: [PATCH v9 00/24] ILP32 for ARM64
@ 2018-10-13  2:07         ` Eugene Syromiatnikov
  0 siblings, 0 replies; 104+ messages in thread
From: Eugene Syromiatnikov @ 2018-10-13  2:07 UTC (permalink / raw)
  To: Szabolcs Nagy
  Cc: Yury Norov, nd, Catalin Marinas, Arnd Bergmann, linux-arm-kernel,
	linux-kernel, linux-doc, linux-arch, linux-api, Adam Borowski,
	Alexander Graf, Alexey Klimov, Andreas Schwab, Andrew Pinski,
	Bamvor Zhangjian, Chris Metcalf, Christoph Muellner, Dave Martin,
	David S . Miller, Florian Weimer, Geert Uytterhoeven, Heiko

On Wed, Oct 10, 2018 at 03:39:07PM +0100, Szabolcs Nagy wrote:
> On 10/10/18 15:10, Eugene Syromiatnikov wrote:
> >  * What's the reasoning behind capping syscall arguments to 32 bit? x32
> >    and MIPS N32 do not have such a restriction (and do not need special
> >    wrappers for syscalls that pass 64-bit values as a result, except
> >    when they do,  as it is the case for preadv2 on x32); moreover, that
> >    would lead to insurmountable difficulties for AArch64 ILP32 tracers
> >    that try to trace LP64 tracees, as it would be impossible to pass
> >    64-bit addresses to process_vm_{read,write} or ptrace PEEK/POKE.
> 
> but that's necessarily the case for all ilp32 abis:
> the userspace syscall function receives 32bit
> arguments so even if the kernel abi takes 64bit
> args you cannot use that from c code. (the libc
> does not even know which args should be sign or
> zero extended.)

glibc's syscall() prototype has kernel_ulong_t as its arguments (more
specifically, to __syscall_ulong_t, which is 64-bit wide on x32; it
should also have kernel_long_t as its return type instead of long,
but that's another story), so it works perfectly fine in case of x32.

> process_vm_readv/writev is limited by the ilp32
> iovec struct, not by the syscall arguments.

Right, on x32/N32 this issue is worked around by the usage of the respective
x86_64/N64 call, and it looks like another thing that is impossible
with AArch64 ilp32.

> ptrace is specified to take void* addr argument,
> and void* is 32bit on all ilp32 targets.
> so again on the c language level there is no
> way around the 32bit limitation.

Which is an issue.

^ permalink raw reply	[flat|nested] 104+ messages in thread

* [PATCH v9 00/24] ILP32 for ARM64
@ 2018-10-13  2:07         ` Eugene Syromiatnikov
  0 siblings, 0 replies; 104+ messages in thread
From: Eugene Syromiatnikov @ 2018-10-13  2:07 UTC (permalink / raw)
  To: linux-arm-kernel

On Wed, Oct 10, 2018 at 03:39:07PM +0100, Szabolcs Nagy wrote:
> On 10/10/18 15:10, Eugene Syromiatnikov wrote:
> >  * What's the reasoning behind capping syscall arguments to 32 bit? x32
> >    and MIPS N32 do not have such a restriction (and do not need special
> >    wrappers for syscalls that pass 64-bit values as a result, except
> >    when they do,  as it is the case for preadv2 on x32); moreover, that
> >    would lead to insurmountable difficulties for AArch64 ILP32 tracers
> >    that try to trace LP64 tracees, as it would be impossible to pass
> >    64-bit addresses to process_vm_{read,write} or ptrace PEEK/POKE.
> 
> but that's necessarily the case for all ilp32 abis:
> the userspace syscall function receives 32bit
> arguments so even if the kernel abi takes 64bit
> args you cannot use that from c code. (the libc
> does not even know which args should be sign or
> zero extended.)

glibc's syscall() prototype has kernel_ulong_t as its arguments (more
specifically, to __syscall_ulong_t, which is 64-bit wide on x32; it
should also have kernel_long_t as its return type instead of long,
but that's another story), so it works perfectly fine in case of x32.

> process_vm_readv/writev is limited by the ilp32
> iovec struct, not by the syscall arguments.

Right, on x32/N32 this issue is worked around by the usage of the respective
x86_64/N64 call, and it looks like another thing that is impossible
with AArch64 ilp32.

> ptrace is specified to take void* addr argument,
> and void* is 32bit on all ilp32 targets.
> so again on the c language level there is no
> way around the 32bit limitation.

Which is an issue.

^ permalink raw reply	[flat|nested] 104+ messages in thread

* Re: [PATCH v9 00/24] ILP32 for ARM64
  2018-10-10 14:10     ` Eugene Syromiatnikov
  (?)
@ 2018-10-10 15:36       ` Catalin Marinas
  -1 siblings, 0 replies; 104+ messages in thread
From: Catalin Marinas @ 2018-10-10 15:36 UTC (permalink / raw)
  To: Eugene Syromiatnikov
  Cc: Yury Norov, Arnd Bergmann, linux-arm-kernel, linux-kernel,
	linux-doc, linux-arch, linux-api, Adam Borowski, Alexander Graf,
	Alexey Klimov, Andreas Schwab, Andrew Pinski, Bamvor Zhangjian,
	Chris Metcalf, Christoph Muellner, Dave Martin, David S . Miller,
	Florian Weimer, Geert Uytterhoeven, Heiko Carstens, James Hogan,
	James Morse, Joseph Myers, Lin Yongting, Manuel Montezelo,
	Mark Brown, Martin Schwidefsky, Maxim Kuvyrkov, Nathan_Lynch,
	Philipp Tomsich, Prasun Kapoor, Ramana Radhakrishnan,
	Steve Ellcey, Szabolcs Nagy, Pavel Machek, Palmer Dabbelt,
	Wookey

On Wed, Oct 10, 2018 at 04:10:21PM +0200, Eugene Syromiatnikov wrote:
> I have some questions regarding AArch64 ILP32 implementation for which I
> failed to find an answer myself:
>  * How ptrace() tracer is supposed to distinguish between ILP32 and LP64
>    tracees? For MIPS N32 and x32 this is possible based on syscall
>    number, but for AArch64 ILP32 I do not see such a sign. There's also
>    ARM_ip is employed for signalling entering/exiting, I wonder whether
>    it's possible to employ it also for signalling tracee's personality.

With the current implementation, I don't think you can distinguish. From
the kernel perspective, the register set is the same. What is the
use-case for this?

We could add a new regset to expose the ILP32 state (NT_ARM_..., I can't
think of a name now but probably not PER* as this implies PER_LINUX_...
which is independent from TIF_32BIT_*).

>  * What's the reasoning behind capping syscall arguments to 32 bit? x32
>    and MIPS N32 do not have such a restriction (and do not need special
>    wrappers for syscalls that pass 64-bit values as a result, except
>    when they do,  as it is the case for preadv2 on x32); moreover, that
>    would lead to insurmountable difficulties for AArch64 ILP32 tracers
>    that try to trace LP64 tracees, as it would be impossible to pass
>    64-bit addresses to process_vm_{read,write} or ptrace PEEK/POKE.

We've attempted in earlier versions to allow a mix of 32 and 64-bit
register values from ILP32 but it got pretty complicated. The entry code
would need to know which registers need zeroing of the top 32-bit and
the generic unistd.h wrapper hacks were not very nice. Some past
discussions:

https://www.mail-archive.com/linux-kernel@vger.kernel.org/msg1211716.html

-- 
Catalin

^ permalink raw reply	[flat|nested] 104+ messages in thread

* Re: [PATCH v9 00/24] ILP32 for ARM64
@ 2018-10-10 15:36       ` Catalin Marinas
  0 siblings, 0 replies; 104+ messages in thread
From: Catalin Marinas @ 2018-10-10 15:36 UTC (permalink / raw)
  To: Eugene Syromiatnikov
  Cc: Yury Norov, Arnd Bergmann, linux-arm-kernel, linux-kernel,
	linux-doc, linux-arch, linux-api, Adam Borowski, Alexander Graf,
	Alexey Klimov, Andreas Schwab, Andrew Pinski, Bamvor Zhangjian,
	Chris Metcalf, Christoph Muellner, Dave Martin, David S . Miller,
	Florian Weimer, Geert Uytterhoeven, Heiko Carstens, James Hogan

On Wed, Oct 10, 2018 at 04:10:21PM +0200, Eugene Syromiatnikov wrote:
> I have some questions regarding AArch64 ILP32 implementation for which I
> failed to find an answer myself:
>  * How ptrace() tracer is supposed to distinguish between ILP32 and LP64
>    tracees? For MIPS N32 and x32 this is possible based on syscall
>    number, but for AArch64 ILP32 I do not see such a sign. There's also
>    ARM_ip is employed for signalling entering/exiting, I wonder whether
>    it's possible to employ it also for signalling tracee's personality.

With the current implementation, I don't think you can distinguish. From
the kernel perspective, the register set is the same. What is the
use-case for this?

We could add a new regset to expose the ILP32 state (NT_ARM_..., I can't
think of a name now but probably not PER* as this implies PER_LINUX_...
which is independent from TIF_32BIT_*).

>  * What's the reasoning behind capping syscall arguments to 32 bit? x32
>    and MIPS N32 do not have such a restriction (and do not need special
>    wrappers for syscalls that pass 64-bit values as a result, except
>    when they do,  as it is the case for preadv2 on x32); moreover, that
>    would lead to insurmountable difficulties for AArch64 ILP32 tracers
>    that try to trace LP64 tracees, as it would be impossible to pass
>    64-bit addresses to process_vm_{read,write} or ptrace PEEK/POKE.

We've attempted in earlier versions to allow a mix of 32 and 64-bit
register values from ILP32 but it got pretty complicated. The entry code
would need to know which registers need zeroing of the top 32-bit and
the generic unistd.h wrapper hacks were not very nice. Some past
discussions:

https://www.mail-archive.com/linux-kernel@vger.kernel.org/msg1211716.html

-- 
Catalin

^ permalink raw reply	[flat|nested] 104+ messages in thread

* [PATCH v9 00/24] ILP32 for ARM64
@ 2018-10-10 15:36       ` Catalin Marinas
  0 siblings, 0 replies; 104+ messages in thread
From: Catalin Marinas @ 2018-10-10 15:36 UTC (permalink / raw)
  To: linux-arm-kernel

On Wed, Oct 10, 2018 at 04:10:21PM +0200, Eugene Syromiatnikov wrote:
> I have some questions regarding AArch64 ILP32 implementation for which I
> failed to find an answer myself:
>  * How ptrace() tracer is supposed to distinguish between ILP32 and LP64
>    tracees? For MIPS N32 and x32 this is possible based on syscall
>    number, but for AArch64 ILP32 I do not see such a sign. There's also
>    ARM_ip is employed for signalling entering/exiting, I wonder whether
>    it's possible to employ it also for signalling tracee's personality.

With the current implementation, I don't think you can distinguish. From
the kernel perspective, the register set is the same. What is the
use-case for this?

We could add a new regset to expose the ILP32 state (NT_ARM_..., I can't
think of a name now but probably not PER* as this implies PER_LINUX_...
which is independent from TIF_32BIT_*).

>  * What's the reasoning behind capping syscall arguments to 32 bit? x32
>    and MIPS N32 do not have such a restriction (and do not need special
>    wrappers for syscalls that pass 64-bit values as a result, except
>    when they do,  as it is the case for preadv2 on x32); moreover, that
>    would lead to insurmountable difficulties for AArch64 ILP32 tracers
>    that try to trace LP64 tracees, as it would be impossible to pass
>    64-bit addresses to process_vm_{read,write} or ptrace PEEK/POKE.

We've attempted in earlier versions to allow a mix of 32 and 64-bit
register values from ILP32 but it got pretty complicated. The entry code
would need to know which registers need zeroing of the top 32-bit and
the generic unistd.h wrapper hacks were not very nice. Some past
discussions:

https://www.mail-archive.com/linux-kernel at vger.kernel.org/msg1211716.html

-- 
Catalin

^ permalink raw reply	[flat|nested] 104+ messages in thread

* Re: [PATCH v9 00/24] ILP32 for ARM64
  2018-10-10 14:10     ` Eugene Syromiatnikov
  (?)
@ 2018-10-10 14:39       ` Szabolcs Nagy
  -1 siblings, 0 replies; 104+ messages in thread
From: Szabolcs Nagy @ 2018-10-10 14:39 UTC (permalink / raw)
  To: Eugene Syromiatnikov, Yury Norov
  Cc: nd, Catalin Marinas, Arnd Bergmann, linux-arm-kernel,
	linux-kernel, linux-doc, linux-arch, linux-api, Adam Borowski,
	Alexander Graf, Alexey Klimov, Andreas Schwab, Andrew Pinski,
	Bamvor Zhangjian, Chris Metcalf, Christoph Muellner, Dave Martin,
	David S . Miller, Florian Weimer, Geert Uytterhoeven,
	Heiko Carstens, James Hogan, James Morse, Joseph Myers,
	Lin Yongting, Manuel Montezelo, Mark Brown, Martin Schwidefsky,
	Maxim Kuvyrkov, Nathan_Lynch, Philipp Tomsich, Prasun Kapoor,
	Ramana Radhakrishnan, Steve Ellcey, Pavel Machek, Palmer Dabbelt,
	Wookey

On 10/10/18 15:10, Eugene Syromiatnikov wrote:
>  * What's the reasoning behind capping syscall arguments to 32 bit? x32
>    and MIPS N32 do not have such a restriction (and do not need special
>    wrappers for syscalls that pass 64-bit values as a result, except
>    when they do,  as it is the case for preadv2 on x32); moreover, that
>    would lead to insurmountable difficulties for AArch64 ILP32 tracers
>    that try to trace LP64 tracees, as it would be impossible to pass
>    64-bit addresses to process_vm_{read,write} or ptrace PEEK/POKE.

but that's necessarily the case for all ilp32 abis:
the userspace syscall function receives 32bit
arguments so even if the kernel abi takes 64bit
args you cannot use that from c code. (the libc
does not even know which args should be sign or
zero extended.)

process_vm_readv/writev is limited by the ilp32
iovec struct, not by the syscall arguments.

ptrace is specified to take void* addr argument,
and void* is 32bit on all ilp32 targets.
so again on the c language level there is no
way around the 32bit limitation.

^ permalink raw reply	[flat|nested] 104+ messages in thread

* Re: [PATCH v9 00/24] ILP32 for ARM64
@ 2018-10-10 14:39       ` Szabolcs Nagy
  0 siblings, 0 replies; 104+ messages in thread
From: Szabolcs Nagy @ 2018-10-10 14:39 UTC (permalink / raw)
  To: Eugene Syromiatnikov, Yury Norov
  Cc: linux-doc, Catalin Marinas, Palmer Dabbelt, Heiko Carstens,
	Pavel Machek, Philipp Tomsich, Joseph Myers, linux-arch,
	Steve Ellcey, Prasun Kapoor, Andreas Schwab, Alexander Graf,
	Geert Uytterhoeven, Bamvor Zhangjian, Dave Martin, Adam Borowski,
	Manuel Montezelo, James Hogan, Chris Metcalf, Arnd Bergmann,
	Andrew Pinski, Lin Yongting, Alexey Klimov

On 10/10/18 15:10, Eugene Syromiatnikov wrote:
>  * What's the reasoning behind capping syscall arguments to 32 bit? x32
>    and MIPS N32 do not have such a restriction (and do not need special
>    wrappers for syscalls that pass 64-bit values as a result, except
>    when they do,  as it is the case for preadv2 on x32); moreover, that
>    would lead to insurmountable difficulties for AArch64 ILP32 tracers
>    that try to trace LP64 tracees, as it would be impossible to pass
>    64-bit addresses to process_vm_{read,write} or ptrace PEEK/POKE.

but that's necessarily the case for all ilp32 abis:
the userspace syscall function receives 32bit
arguments so even if the kernel abi takes 64bit
args you cannot use that from c code. (the libc
does not even know which args should be sign or
zero extended.)

process_vm_readv/writev is limited by the ilp32
iovec struct, not by the syscall arguments.

ptrace is specified to take void* addr argument,
and void* is 32bit on all ilp32 targets.
so again on the c language level there is no
way around the 32bit limitation.

^ permalink raw reply	[flat|nested] 104+ messages in thread

* [PATCH v9 00/24] ILP32 for ARM64
@ 2018-10-10 14:39       ` Szabolcs Nagy
  0 siblings, 0 replies; 104+ messages in thread
From: Szabolcs Nagy @ 2018-10-10 14:39 UTC (permalink / raw)
  To: linux-arm-kernel

On 10/10/18 15:10, Eugene Syromiatnikov wrote:
>  * What's the reasoning behind capping syscall arguments to 32 bit? x32
>    and MIPS N32 do not have such a restriction (and do not need special
>    wrappers for syscalls that pass 64-bit values as a result, except
>    when they do,  as it is the case for preadv2 on x32); moreover, that
>    would lead to insurmountable difficulties for AArch64 ILP32 tracers
>    that try to trace LP64 tracees, as it would be impossible to pass
>    64-bit addresses to process_vm_{read,write} or ptrace PEEK/POKE.

but that's necessarily the case for all ilp32 abis:
the userspace syscall function receives 32bit
arguments so even if the kernel abi takes 64bit
args you cannot use that from c code. (the libc
does not even know which args should be sign or
zero extended.)

process_vm_readv/writev is limited by the ilp32
iovec struct, not by the syscall arguments.

ptrace is specified to take void* addr argument,
and void* is 32bit on all ilp32 targets.
so again on the c language level there is no
way around the 32bit limitation.

^ permalink raw reply	[flat|nested] 104+ messages in thread

* Re: [PATCH v9 00/24] ILP32 for ARM64
  2018-10-10 14:10     ` Eugene Syromiatnikov
  (?)
@ 2018-10-10 14:18       ` Arnd Bergmann
  -1 siblings, 0 replies; 104+ messages in thread
From: Arnd Bergmann @ 2018-10-10 14:18 UTC (permalink / raw)
  To: Eugene Syromiatnikov
  Cc: Yury Norov, Catalin Marinas, linux-arm-kernel, linux-kernel,
	linux-doc, linux-arch, linux-api, Adam Borowski, Alexander Graf,
	Alexey Klimov, Andreas Schwab, Andrew Pinski, Bamvor Zhangjian,
	Chris Metcalf, Christoph Muellner, Dave Martin, David S . Miller,
	Florian Weimer, Geert Uytterhoeven, Heiko Carstens, James Hogan,
	James Morse, Joseph Myers, Lin Yongting, Manuel Montezelo,
	Mark Brown, Martin Schwidefsky, Maxim Kuvyrkov, Nathan_Lynch,
	Philipp Tomsich, Prasun Kapoor, Ramana Radhakrishnan,
	Steve Ellcey, Szabolcs Nagy, Pavel Machek, Palmer Dabbelt,
	Wookey

On 10/10/18, Eugene Syromiatnikov <esyr@redhat.com> wrote:
> On Tue, Jul 24, 2018 at 08:39:57PM +0300, Yury Norov wrote:
>> Hi all,
>>
>> + Pavel Machek, Palmer Dabbelt, Wookey.
>>
>> On Wed, May 16, 2018 at 11:18:45AM +0300, Yury Norov wrote:
>> > This series enables AARCH64 with ILP32 mode.
>> >
>> > As supporting work, it introduces ARCH_32BIT_OFF_T configuration
>> > option that is enabled for existing 32-bit architectures but disabled
>> > for new arches (so 64-bit off_t userspace type is used by new
>> > userspace).
>> > Also it deprecates getrlimit and setrlimit syscalls prior to prlimit64.
>> >
>> > Based on kernel v4.16. Tested with LTP, glibc testsuite, trinity,
>> > lmbench,
>> > CPUSpec.
>
>> This is the update of the series based on 4.17 kernel
>> https://github.com/norov/linux/tree/ilp32-4.17
>
> Hello.
>
> I have some questions regarding AArch64 ILP32 implementation for which I
> failed to find an answer myself:
>  * How ptrace() tracer is supposed to distinguish between ILP32 and LP64
>    tracees? For MIPS N32 and x32 this is possible based on syscall
>    number, but for AArch64 ILP32 I do not see such a sign. There's also
>    ARM_ip is employed for signalling entering/exiting, I wonder whether
>    it's possible to employ it also for signalling tracee's personality.

Don't know.

>  * What's the reasoning behind capping syscall arguments to 32 bit? x32
>    and MIPS N32 do not have such a restriction (and do not need special
>    wrappers for syscalls that pass 64-bit values as a result, except
>    when they do,  as it is the case for preadv2 on x32); moreover, that
>    would lead to insurmountable difficulties for AArch64 ILP32 tracers
>    that try to trace LP64 tracees, as it would be impossible to pass
>    64-bit addresses to process_vm_{read,write} or ptrace PEEK/POKE.

The idea is to keep the syscall entry points as similar as possible
between arm (aarch32) emulation and aarch64-ilp32 mode when
you have a kernel that supports both.

      Arnd

^ permalink raw reply	[flat|nested] 104+ messages in thread

* Re: [PATCH v9 00/24] ILP32 for ARM64
@ 2018-10-10 14:18       ` Arnd Bergmann
  0 siblings, 0 replies; 104+ messages in thread
From: Arnd Bergmann @ 2018-10-10 14:18 UTC (permalink / raw)
  To: Eugene Syromiatnikov
  Cc: Yury Norov, Catalin Marinas, linux-arm-kernel, linux-kernel,
	linux-doc, linux-arch, linux-api, Adam Borowski, Alexander Graf,
	Alexey Klimov, Andreas Schwab, Andrew Pinski, Bamvor Zhangjian,
	Chris Metcalf, Christoph Muellner, Dave Martin, David S . Miller,
	Florian Weimer, Geert Uytterhoeven, Heiko Carstens, James

On 10/10/18, Eugene Syromiatnikov <esyr@redhat.com> wrote:
> On Tue, Jul 24, 2018 at 08:39:57PM +0300, Yury Norov wrote:
>> Hi all,
>>
>> + Pavel Machek, Palmer Dabbelt, Wookey.
>>
>> On Wed, May 16, 2018 at 11:18:45AM +0300, Yury Norov wrote:
>> > This series enables AARCH64 with ILP32 mode.
>> >
>> > As supporting work, it introduces ARCH_32BIT_OFF_T configuration
>> > option that is enabled for existing 32-bit architectures but disabled
>> > for new arches (so 64-bit off_t userspace type is used by new
>> > userspace).
>> > Also it deprecates getrlimit and setrlimit syscalls prior to prlimit64.
>> >
>> > Based on kernel v4.16. Tested with LTP, glibc testsuite, trinity,
>> > lmbench,
>> > CPUSpec.
>
>> This is the update of the series based on 4.17 kernel
>> https://github.com/norov/linux/tree/ilp32-4.17
>
> Hello.
>
> I have some questions regarding AArch64 ILP32 implementation for which I
> failed to find an answer myself:
>  * How ptrace() tracer is supposed to distinguish between ILP32 and LP64
>    tracees? For MIPS N32 and x32 this is possible based on syscall
>    number, but for AArch64 ILP32 I do not see such a sign. There's also
>    ARM_ip is employed for signalling entering/exiting, I wonder whether
>    it's possible to employ it also for signalling tracee's personality.

Don't know.

>  * What's the reasoning behind capping syscall arguments to 32 bit? x32
>    and MIPS N32 do not have such a restriction (and do not need special
>    wrappers for syscalls that pass 64-bit values as a result, except
>    when they do,  as it is the case for preadv2 on x32); moreover, that
>    would lead to insurmountable difficulties for AArch64 ILP32 tracers
>    that try to trace LP64 tracees, as it would be impossible to pass
>    64-bit addresses to process_vm_{read,write} or ptrace PEEK/POKE.

The idea is to keep the syscall entry points as similar as possible
between arm (aarch32) emulation and aarch64-ilp32 mode when
you have a kernel that supports both.

      Arnd

^ permalink raw reply	[flat|nested] 104+ messages in thread

* [PATCH v9 00/24] ILP32 for ARM64
@ 2018-10-10 14:18       ` Arnd Bergmann
  0 siblings, 0 replies; 104+ messages in thread
From: Arnd Bergmann @ 2018-10-10 14:18 UTC (permalink / raw)
  To: linux-arm-kernel

On 10/10/18, Eugene Syromiatnikov <esyr@redhat.com> wrote:
> On Tue, Jul 24, 2018 at 08:39:57PM +0300, Yury Norov wrote:
>> Hi all,
>>
>> + Pavel Machek, Palmer Dabbelt, Wookey.
>>
>> On Wed, May 16, 2018 at 11:18:45AM +0300, Yury Norov wrote:
>> > This series enables AARCH64 with ILP32 mode.
>> >
>> > As supporting work, it introduces ARCH_32BIT_OFF_T configuration
>> > option that is enabled for existing 32-bit architectures but disabled
>> > for new arches (so 64-bit off_t userspace type is used by new
>> > userspace).
>> > Also it deprecates getrlimit and setrlimit syscalls prior to prlimit64.
>> >
>> > Based on kernel v4.16. Tested with LTP, glibc testsuite, trinity,
>> > lmbench,
>> > CPUSpec.
>
>> This is the update of the series based on 4.17 kernel
>> https://github.com/norov/linux/tree/ilp32-4.17
>
> Hello.
>
> I have some questions regarding AArch64 ILP32 implementation for which I
> failed to find an answer myself:
>  * How ptrace() tracer is supposed to distinguish between ILP32 and LP64
>    tracees? For MIPS N32 and x32 this is possible based on syscall
>    number, but for AArch64 ILP32 I do not see such a sign. There's also
>    ARM_ip is employed for signalling entering/exiting, I wonder whether
>    it's possible to employ it also for signalling tracee's personality.

Don't know.

>  * What's the reasoning behind capping syscall arguments to 32 bit? x32
>    and MIPS N32 do not have such a restriction (and do not need special
>    wrappers for syscalls that pass 64-bit values as a result, except
>    when they do,  as it is the case for preadv2 on x32); moreover, that
>    would lead to insurmountable difficulties for AArch64 ILP32 tracers
>    that try to trace LP64 tracees, as it would be impossible to pass
>    64-bit addresses to process_vm_{read,write} or ptrace PEEK/POKE.

The idea is to keep the syscall entry points as similar as possible
between arm (aarch32) emulation and aarch64-ilp32 mode when
you have a kernel that supports both.

      Arnd

^ permalink raw reply	[flat|nested] 104+ messages in thread

* Re: [PATCH v9 00/24] ILP32 for ARM64
  2018-07-24 17:39   ` Yury Norov
  (?)
@ 2018-10-10 14:10     ` Eugene Syromiatnikov
  -1 siblings, 0 replies; 104+ messages in thread
From: Eugene Syromiatnikov @ 2018-10-10 14:10 UTC (permalink / raw)
  To: Yury Norov
  Cc: Catalin Marinas, Arnd Bergmann, linux-arm-kernel, linux-kernel,
	linux-doc, linux-arch, linux-api, Adam Borowski, Alexander Graf,
	Alexey Klimov, Andreas Schwab, Andrew Pinski, Bamvor Zhangjian,
	Chris Metcalf, Christoph Muellner, Dave Martin, David S . Miller,
	Florian Weimer, Geert Uytterhoeven, Heiko Carstens, James Hogan,
	James Morse, Joseph Myers, Lin Yongting, Manuel Montezelo,
	Mark Brown, Martin Schwidefsky, Maxim Kuvyrkov, Nathan_Lynch,
	Philipp Tomsich, Prasun Kapoor, Ramana Radhakrishnan,
	Steve Ellcey, Szabolcs Nagy, Pavel Machek, Palmer Dabbelt,
	Wookey

On Tue, Jul 24, 2018 at 08:39:57PM +0300, Yury Norov wrote:
> Hi all,
> 
> + Pavel Machek, Palmer Dabbelt, Wookey.
> 
> On Wed, May 16, 2018 at 11:18:45AM +0300, Yury Norov wrote:
> > This series enables AARCH64 with ILP32 mode.
> > 
> > As supporting work, it introduces ARCH_32BIT_OFF_T configuration
> > option that is enabled for existing 32-bit architectures but disabled
> > for new arches (so 64-bit off_t userspace type is used by new userspace).
> > Also it deprecates getrlimit and setrlimit syscalls prior to prlimit64.
> > 
> > Based on kernel v4.16. Tested with LTP, glibc testsuite, trinity, lmbench,
> > CPUSpec.

> This is the update of the series based on 4.17 kernel
> https://github.com/norov/linux/tree/ilp32-4.17

Hello.

I have some questions regarding AArch64 ILP32 implementation for which I
failed to find an answer myself:
 * How ptrace() tracer is supposed to distinguish between ILP32 and LP64
   tracees? For MIPS N32 and x32 this is possible based on syscall
   number, but for AArch64 ILP32 I do not see such a sign. There's also
   ARM_ip is employed for signalling entering/exiting, I wonder whether
   it's possible to employ it also for signalling tracee's personality.
 * What's the reasoning behind capping syscall arguments to 32 bit? x32
   and MIPS N32 do not have such a restriction (and do not need special
   wrappers for syscalls that pass 64-bit values as a result, except
   when they do,  as it is the case for preadv2 on x32); moreover, that
   would lead to insurmountable difficulties for AArch64 ILP32 tracers
   that try to trace LP64 tracees, as it would be impossible to pass
   64-bit addresses to process_vm_{read,write} or ptrace PEEK/POKE.

Thank you.

^ permalink raw reply	[flat|nested] 104+ messages in thread

* Re: [PATCH v9 00/24] ILP32 for ARM64
@ 2018-10-10 14:10     ` Eugene Syromiatnikov
  0 siblings, 0 replies; 104+ messages in thread
From: Eugene Syromiatnikov @ 2018-10-10 14:10 UTC (permalink / raw)
  To: Yury Norov
  Cc: Catalin Marinas, Arnd Bergmann, linux-arm-kernel, linux-kernel,
	linux-doc, linux-arch, linux-api, Adam Borowski, Alexander Graf,
	Alexey Klimov, Andreas Schwab, Andrew Pinski, Bamvor Zhangjian,
	Chris Metcalf, Christoph Muellner, Dave Martin, David S . Miller,
	Florian Weimer, Geert Uytterhoeven, Heiko Carstens, James Hogan

On Tue, Jul 24, 2018 at 08:39:57PM +0300, Yury Norov wrote:
> Hi all,
> 
> + Pavel Machek, Palmer Dabbelt, Wookey.
> 
> On Wed, May 16, 2018 at 11:18:45AM +0300, Yury Norov wrote:
> > This series enables AARCH64 with ILP32 mode.
> > 
> > As supporting work, it introduces ARCH_32BIT_OFF_T configuration
> > option that is enabled for existing 32-bit architectures but disabled
> > for new arches (so 64-bit off_t userspace type is used by new userspace).
> > Also it deprecates getrlimit and setrlimit syscalls prior to prlimit64.
> > 
> > Based on kernel v4.16. Tested with LTP, glibc testsuite, trinity, lmbench,
> > CPUSpec.

> This is the update of the series based on 4.17 kernel
> https://github.com/norov/linux/tree/ilp32-4.17

Hello.

I have some questions regarding AArch64 ILP32 implementation for which I
failed to find an answer myself:
 * How ptrace() tracer is supposed to distinguish between ILP32 and LP64
   tracees? For MIPS N32 and x32 this is possible based on syscall
   number, but for AArch64 ILP32 I do not see such a sign. There's also
   ARM_ip is employed for signalling entering/exiting, I wonder whether
   it's possible to employ it also for signalling tracee's personality.
 * What's the reasoning behind capping syscall arguments to 32 bit? x32
   and MIPS N32 do not have such a restriction (and do not need special
   wrappers for syscalls that pass 64-bit values as a result, except
   when they do,  as it is the case for preadv2 on x32); moreover, that
   would lead to insurmountable difficulties for AArch64 ILP32 tracers
   that try to trace LP64 tracees, as it would be impossible to pass
   64-bit addresses to process_vm_{read,write} or ptrace PEEK/POKE.

Thank you.

^ permalink raw reply	[flat|nested] 104+ messages in thread

* [PATCH v9 00/24] ILP32 for ARM64
@ 2018-10-10 14:10     ` Eugene Syromiatnikov
  0 siblings, 0 replies; 104+ messages in thread
From: Eugene Syromiatnikov @ 2018-10-10 14:10 UTC (permalink / raw)
  To: linux-arm-kernel

On Tue, Jul 24, 2018 at 08:39:57PM +0300, Yury Norov wrote:
> Hi all,
> 
> + Pavel Machek, Palmer Dabbelt, Wookey.
> 
> On Wed, May 16, 2018 at 11:18:45AM +0300, Yury Norov wrote:
> > This series enables AARCH64 with ILP32 mode.
> > 
> > As supporting work, it introduces ARCH_32BIT_OFF_T configuration
> > option that is enabled for existing 32-bit architectures but disabled
> > for new arches (so 64-bit off_t userspace type is used by new userspace).
> > Also it deprecates getrlimit and setrlimit syscalls prior to prlimit64.
> > 
> > Based on kernel v4.16. Tested with LTP, glibc testsuite, trinity, lmbench,
> > CPUSpec.

> This is the update of the series based on 4.17 kernel
> https://github.com/norov/linux/tree/ilp32-4.17

Hello.

I have some questions regarding AArch64 ILP32 implementation for which I
failed to find an answer myself:
 * How ptrace() tracer is supposed to distinguish between ILP32 and LP64
   tracees? For MIPS N32 and x32 this is possible based on syscall
   number, but for AArch64 ILP32 I do not see such a sign. There's also
   ARM_ip is employed for signalling entering/exiting, I wonder whether
   it's possible to employ it also for signalling tracee's personality.
 * What's the reasoning behind capping syscall arguments to 32 bit? x32
   and MIPS N32 do not have such a restriction (and do not need special
   wrappers for syscalls that pass 64-bit values as a result, except
   when they do,  as it is the case for preadv2 on x32); moreover, that
   would lead to insurmountable difficulties for AArch64 ILP32 tracers
   that try to trace LP64 tracees, as it would be impossible to pass
   64-bit addresses to process_vm_{read,write} or ptrace PEEK/POKE.

Thank you.

^ permalink raw reply	[flat|nested] 104+ messages in thread

* Re: [PATCH v9 00/24] ILP32 for ARM64
  2018-07-24 17:39   ` Yury Norov
  (?)
  (?)
@ 2018-07-25  9:48     ` Andreas Schwab
  -1 siblings, 0 replies; 104+ messages in thread
From: Andreas Schwab @ 2018-07-25  9:48 UTC (permalink / raw)
  To: Yury Norov
  Cc: Catalin Marinas, Arnd Bergmann, linux-arm-kernel, linux-kernel,
	linux-doc, linux-arch, linux-api, Adam Borowski, Alexander Graf,
	Alexey Klimov, Andrew Pinski, Bamvor Zhangjian, Chris Metcalf,
	Christoph Muellner, Dave Martin, David S . Miller,
	Florian Weimer, Geert Uytterhoeven, Heiko Carstens, James Hogan,
	James Morse, Joseph Myers, Lin Yongting, Manuel Montezelo,
	Mark Brown, Martin Schwidefsky, Maxim Kuvyrkov, Nathan_Lynch,
	Philipp Tomsich, Prasun Kapoor, Ramana Radhakrishnan,
	Steve Ellcey, Szabolcs Nagy, Pavel Machek, Palmer Dabbelt,
	Wookey

On Jul 24 2018, Yury Norov <ynorov@caviumnetworks.com> wrote:

> This is the update of the series based on 4.17 kernel
> https://github.com/norov/linux/tree/ilp32-4.17

Note that commit 947bd8e7cd (arm64: ilp32: add
is_ilp32_compat_{task,thread} and TIF_32BIT_AARCH64) conflicts with
commit 9dd9614f54 (arm64: ssbd: Introduce thread flag to control
userspace mitigation) (which has been backported to stable).

Andreas.

-- 
Andreas Schwab, SUSE Labs, schwab@suse.de
GPG Key fingerprint = 0196 BAD8 1CE9 1970 F4BE  1748 E4D4 88E3 0EEA B9D7
"And now for something completely different."

^ permalink raw reply	[flat|nested] 104+ messages in thread

* Re: [PATCH v9 00/24] ILP32 for ARM64
@ 2018-07-25  9:48     ` Andreas Schwab
  0 siblings, 0 replies; 104+ messages in thread
From: Andreas Schwab @ 2018-07-25  9:48 UTC (permalink / raw)
  To: Yury Norov
  Cc: Catalin Marinas, Arnd Bergmann, linux-arm-kernel, linux-kernel,
	linux-doc, linux-arch, linux-api, Adam Borowski, Alexander Graf,
	Alexey Klimov, Andrew Pinski, Bamvor Zhangjian, Chris Metcalf,
	Christoph Muellner, Dave Martin, David S . Miller,
	Florian Weimer, Geert Uytterhoeven, Heiko Carstens, James Hogan,
	James Morse, Joseph Myers, Lin Yongting, Manuel Montezelo,
	Mark Brown, Martin Schwidefsky, Maxim Kuvyrkov, Nathan_Lynch,
	Philipp Tomsich, Prasun Kapoor, Ramana Radhakrishnan,
	Steve Ellcey, Szabolcs Nagy, Pavel Machek, Palmer Dabbelt,
	Wookey

On Jul 24 2018, Yury Norov <ynorov@caviumnetworks.com> wrote:

> This is the update of the series based on 4.17 kernel
> https://github.com/norov/linux/tree/ilp32-4.17

Note that commit 947bd8e7cd (arm64: ilp32: add
is_ilp32_compat_{task,thread} and TIF_32BIT_AARCH64) conflicts with
commit 9dd9614f54 (arm64: ssbd: Introduce thread flag to control
userspace mitigation) (which has been backported to stable).

Andreas.

-- 
Andreas Schwab, SUSE Labs, schwab@suse.de
GPG Key fingerprint = 0196 BAD8 1CE9 1970 F4BE  1748 E4D4 88E3 0EEA B9D7
"And now for something completely different."
--
To unsubscribe from this list: send the line "unsubscribe linux-doc" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 104+ messages in thread

* Re: [PATCH v9 00/24] ILP32 for ARM64
@ 2018-07-25  9:48     ` Andreas Schwab
  0 siblings, 0 replies; 104+ messages in thread
From: Andreas Schwab @ 2018-07-25  9:48 UTC (permalink / raw)
  To: Yury Norov
  Cc: Catalin Marinas, Arnd Bergmann, linux-arm-kernel, linux-kernel,
	linux-doc, linux-arch, linux-api, Adam Borowski, Alexander Graf,
	Alexey Klimov, Andrew Pinski, Bamvor Zhangjian, Chris Metcalf,
	Christoph Muellner, Dave Martin, David S . Miller,
	Florian Weimer, Geert Uytterhoeven, Heiko Carstens, James Hogan

On Jul 24 2018, Yury Norov <ynorov@caviumnetworks.com> wrote:

> This is the update of the series based on 4.17 kernel
> https://github.com/norov/linux/tree/ilp32-4.17

Note that commit 947bd8e7cd (arm64: ilp32: add
is_ilp32_compat_{task,thread} and TIF_32BIT_AARCH64) conflicts with
commit 9dd9614f54 (arm64: ssbd: Introduce thread flag to control
userspace mitigation) (which has been backported to stable).

Andreas.

-- 
Andreas Schwab, SUSE Labs, schwab@suse.de
GPG Key fingerprint = 0196 BAD8 1CE9 1970 F4BE  1748 E4D4 88E3 0EEA B9D7
"And now for something completely different."

^ permalink raw reply	[flat|nested] 104+ messages in thread

* [PATCH v9 00/24] ILP32 for ARM64
@ 2018-07-25  9:48     ` Andreas Schwab
  0 siblings, 0 replies; 104+ messages in thread
From: Andreas Schwab @ 2018-07-25  9:48 UTC (permalink / raw)
  To: linux-arm-kernel

On Jul 24 2018, Yury Norov <ynorov@caviumnetworks.com> wrote:

> This is the update of the series based on 4.17 kernel
> https://github.com/norov/linux/tree/ilp32-4.17

Note that commit 947bd8e7cd (arm64: ilp32: add
is_ilp32_compat_{task,thread} and TIF_32BIT_AARCH64) conflicts with
commit 9dd9614f54 (arm64: ssbd: Introduce thread flag to control
userspace mitigation) (which has been backported to stable).

Andreas.

-- 
Andreas Schwab, SUSE Labs, schwab at suse.de
GPG Key fingerprint = 0196 BAD8 1CE9 1970 F4BE  1748 E4D4 88E3 0EEA B9D7
"And now for something completely different."

^ permalink raw reply	[flat|nested] 104+ messages in thread

* Re: [PATCH v9 00/24] ILP32 for ARM64
  2018-05-16  8:18 ` Yury Norov
  (?)
  (?)
@ 2018-07-24 17:39   ` Yury Norov
  -1 siblings, 0 replies; 104+ messages in thread
From: Yury Norov @ 2018-07-24 17:39 UTC (permalink / raw)
  To: Catalin Marinas, Arnd Bergmann, linux-arm-kernel, linux-kernel,
	linux-doc, linux-arch, linux-api
  Cc: Adam Borowski, Alexander Graf, Alexey Klimov, Andreas Schwab,
	Andrew Pinski, Bamvor Zhangjian, Chris Metcalf,
	Christoph Muellner, Dave Martin, David S . Miller,
	Florian Weimer, Geert Uytterhoeven, Heiko Carstens, James Hogan,
	James Morse, Joseph Myers, Lin Yongting, Manuel Montezelo,
	Mark Brown, Martin Schwidefsky, Maxim Kuvyrkov, Nathan_Lynch,
	Philipp Tomsich, Prasun Kapoor, Ramana Radhakrishnan,
	Steve Ellcey, Szabolcs Nagy, Pavel Machek, Palmer Dabbelt,
	Wookey

Hi all,

+ Pavel Machek, Palmer Dabbelt, Wookey.

On Wed, May 16, 2018 at 11:18:45AM +0300, Yury Norov wrote:
> This series enables AARCH64 with ILP32 mode.
> 
> As supporting work, it introduces ARCH_32BIT_OFF_T configuration
> option that is enabled for existing 32-bit architectures but disabled
> for new arches (so 64-bit off_t userspace type is used by new userspace).
> Also it deprecates getrlimit and setrlimit syscalls prior to prlimit64.
> 
> Based on kernel v4.16. Tested with LTP, glibc testsuite, trinity, lmbench,
> CPUSpec.
> 
> This series on github: 
> https://github.com/norov/linux/tree/ilp32-4.16
> Linaro toolchain:
> http://snapshots.linaro.org/components/toolchain/binaries/7.3-2018.04-rc1/aarch64-linux-gnu_ilp32/
> Debian repo:
> http://people.linaro.org/~wookey/ilp32/
> OpenSUSE repo:
> https://build.opensuse.org/project/show/devel:ARM:Factory:Contrib:ILP32
> 
> Changes:
> v3: https://lkml.org/lkml/2014/9/3/704
> v4: https://lkml.org/lkml/2015/4/13/691
> v5: https://lkml.org/lkml/2015/9/29/911
> v6: https://lkml.org/lkml/2016/5/23/661
> v7: https://lkml.org/lkml/2017/1/9/213
> v8: https://lkml.org/lkml/2017/6/19/624
> v9: - rebased on top of v4.16;
>     - signal subsystem reworked to avoid code duplication, as requested
>       by Dave Martin (patches 18 and 20);
>     - new files introduced in series use SPDX notation for license;
>     - linux-api and linux-arch CCed as the series changes kernel ABI;
>     - checkpatch and other minor fixes.
>     - Zhou Chengming's reported-by for patch 2 and signed-off-by for
>       patch 21 removed because his email became invalid. Zhou, please
>       share your new email.

This is the update of the series based on 4.17 kernel
https://github.com/norov/linux/tree/ilp32-4.17
with the following non-critical changes:
 - documentation patch extended with few words about ILP32 in general, and
   the link to ARM document about it added;
 - nds32 and riscv32 exceptions added for ARCH_32BIT_OFF_T and
   {get,set}rlimit (patches 4 and 5).
 - changes to architectures that are unsupported anymore are dropped.
 - Chris Metcalf's ack for patch #3 removed, as it is related to
   tile32 which is unsupported now.

Reminder to Arnd. There's arch subseries acked by you but still
without progress. Could you consider taking it upstream?
[PATCH 03/24] compat ABI: use non-compat openat and open_by_handle_at variants
[PATCH 04/24] 32-bit userspace ABI: introduce ARCH_32BIT_OFF_T config option
[PATCH 05/24] asm-generic: Drop getrlimit and setrlimit syscalls from default list

Yury

^ permalink raw reply	[flat|nested] 104+ messages in thread

* Re: [PATCH v9 00/24] ILP32 for ARM64
@ 2018-07-24 17:39   ` Yury Norov
  0 siblings, 0 replies; 104+ messages in thread
From: Yury Norov @ 2018-07-24 17:39 UTC (permalink / raw)
  To: Catalin Marinas, Arnd Bergmann, linux-arm-kernel, linux-kernel,
	linux-doc, linux-arch, linux-api
  Cc: Adam Borowski, Alexander Graf, Alexey Klimov, Andreas Schwab,
	Andrew Pinski, Bamvor Zhangjian, Chris Metcalf,
	Christoph Muellner, Dave Martin, David S . Miller,
	Florian Weimer, Geert Uytterhoeven, Heiko Carstens, James Hogan,
	James Morse, Joseph Myers, Lin Yongting, Manuel Montezelo,
	Mark Brown, Martin Schwidefsky, Maxim Kuvyrkov, Nathan_Lynch,
	Philipp Tomsich, Prasun Kapoor, Ramana Radhakrishnan,
	Steve Ellcey, Szabolcs Nagy, Pavel Machek, Palmer Dabbelt,
	Wookey

Hi all,

+ Pavel Machek, Palmer Dabbelt, Wookey.

On Wed, May 16, 2018 at 11:18:45AM +0300, Yury Norov wrote:
> This series enables AARCH64 with ILP32 mode.
> 
> As supporting work, it introduces ARCH_32BIT_OFF_T configuration
> option that is enabled for existing 32-bit architectures but disabled
> for new arches (so 64-bit off_t userspace type is used by new userspace).
> Also it deprecates getrlimit and setrlimit syscalls prior to prlimit64.
> 
> Based on kernel v4.16. Tested with LTP, glibc testsuite, trinity, lmbench,
> CPUSpec.
> 
> This series on github: 
> https://github.com/norov/linux/tree/ilp32-4.16
> Linaro toolchain:
> http://snapshots.linaro.org/components/toolchain/binaries/7.3-2018.04-rc1/aarch64-linux-gnu_ilp32/
> Debian repo:
> http://people.linaro.org/~wookey/ilp32/
> OpenSUSE repo:
> https://build.opensuse.org/project/show/devel:ARM:Factory:Contrib:ILP32
> 
> Changes:
> v3: https://lkml.org/lkml/2014/9/3/704
> v4: https://lkml.org/lkml/2015/4/13/691
> v5: https://lkml.org/lkml/2015/9/29/911
> v6: https://lkml.org/lkml/2016/5/23/661
> v7: https://lkml.org/lkml/2017/1/9/213
> v8: https://lkml.org/lkml/2017/6/19/624
> v9: - rebased on top of v4.16;
>     - signal subsystem reworked to avoid code duplication, as requested
>       by Dave Martin (patches 18 and 20);
>     - new files introduced in series use SPDX notation for license;
>     - linux-api and linux-arch CCed as the series changes kernel ABI;
>     - checkpatch and other minor fixes.
>     - Zhou Chengming's reported-by for patch 2 and signed-off-by for
>       patch 21 removed because his email became invalid. Zhou, please
>       share your new email.

This is the update of the series based on 4.17 kernel
https://github.com/norov/linux/tree/ilp32-4.17
with the following non-critical changes:
 - documentation patch extended with few words about ILP32 in general, and
   the link to ARM document about it added;
 - nds32 and riscv32 exceptions added for ARCH_32BIT_OFF_T and
   {get,set}rlimit (patches 4 and 5).
 - changes to architectures that are unsupported anymore are dropped.
 - Chris Metcalf's ack for patch #3 removed, as it is related to
   tile32 which is unsupported now.

Reminder to Arnd. There's arch subseries acked by you but still
without progress. Could you consider taking it upstream?
[PATCH 03/24] compat ABI: use non-compat openat and open_by_handle_at variants
[PATCH 04/24] 32-bit userspace ABI: introduce ARCH_32BIT_OFF_T config option
[PATCH 05/24] asm-generic: Drop getrlimit and setrlimit syscalls from default list

Yury
--
To unsubscribe from this list: send the line "unsubscribe linux-doc" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 104+ messages in thread

* Re: [PATCH v9 00/24] ILP32 for ARM64
@ 2018-07-24 17:39   ` Yury Norov
  0 siblings, 0 replies; 104+ messages in thread
From: Yury Norov @ 2018-07-24 17:39 UTC (permalink / raw)
  To: Catalin Marinas, Arnd Bergmann, linux-arm-kernel, linux-kernel,
	linux-doc, linux-arch, linux-api
  Cc: Adam Borowski, Alexander Graf, Alexey Klimov, Andreas Schwab,
	Andrew Pinski, Bamvor Zhangjian, Chris Metcalf,
	Christoph Muellner, Dave Martin, David S . Miller,
	Florian Weimer, Geert Uytterhoeven, Heiko Carstens, James Hogan,
	James Morse, Joseph Myers, Lin Yongting, Manuel Montezelo,
	Mark Brown

Hi all,

+ Pavel Machek, Palmer Dabbelt, Wookey.

On Wed, May 16, 2018 at 11:18:45AM +0300, Yury Norov wrote:
> This series enables AARCH64 with ILP32 mode.
> 
> As supporting work, it introduces ARCH_32BIT_OFF_T configuration
> option that is enabled for existing 32-bit architectures but disabled
> for new arches (so 64-bit off_t userspace type is used by new userspace).
> Also it deprecates getrlimit and setrlimit syscalls prior to prlimit64.
> 
> Based on kernel v4.16. Tested with LTP, glibc testsuite, trinity, lmbench,
> CPUSpec.
> 
> This series on github: 
> https://github.com/norov/linux/tree/ilp32-4.16
> Linaro toolchain:
> http://snapshots.linaro.org/components/toolchain/binaries/7.3-2018.04-rc1/aarch64-linux-gnu_ilp32/
> Debian repo:
> http://people.linaro.org/~wookey/ilp32/
> OpenSUSE repo:
> https://build.opensuse.org/project/show/devel:ARM:Factory:Contrib:ILP32
> 
> Changes:
> v3: https://lkml.org/lkml/2014/9/3/704
> v4: https://lkml.org/lkml/2015/4/13/691
> v5: https://lkml.org/lkml/2015/9/29/911
> v6: https://lkml.org/lkml/2016/5/23/661
> v7: https://lkml.org/lkml/2017/1/9/213
> v8: https://lkml.org/lkml/2017/6/19/624
> v9: - rebased on top of v4.16;
>     - signal subsystem reworked to avoid code duplication, as requested
>       by Dave Martin (patches 18 and 20);
>     - new files introduced in series use SPDX notation for license;
>     - linux-api and linux-arch CCed as the series changes kernel ABI;
>     - checkpatch and other minor fixes.
>     - Zhou Chengming's reported-by for patch 2 and signed-off-by for
>       patch 21 removed because his email became invalid. Zhou, please
>       share your new email.

This is the update of the series based on 4.17 kernel
https://github.com/norov/linux/tree/ilp32-4.17
with the following non-critical changes:
 - documentation patch extended with few words about ILP32 in general, and
   the link to ARM document about it added;
 - nds32 and riscv32 exceptions added for ARCH_32BIT_OFF_T and
   {get,set}rlimit (patches 4 and 5).
 - changes to architectures that are unsupported anymore are dropped.
 - Chris Metcalf's ack for patch #3 removed, as it is related to
   tile32 which is unsupported now.

Reminder to Arnd. There's arch subseries acked by you but still
without progress. Could you consider taking it upstream?
[PATCH 03/24] compat ABI: use non-compat openat and open_by_handle_at variants
[PATCH 04/24] 32-bit userspace ABI: introduce ARCH_32BIT_OFF_T config option
[PATCH 05/24] asm-generic: Drop getrlimit and setrlimit syscalls from default list

Yury

^ permalink raw reply	[flat|nested] 104+ messages in thread

* [PATCH v9 00/24] ILP32 for ARM64
@ 2018-07-24 17:39   ` Yury Norov
  0 siblings, 0 replies; 104+ messages in thread
From: Yury Norov @ 2018-07-24 17:39 UTC (permalink / raw)
  To: linux-arm-kernel

Hi all,

+ Pavel Machek, Palmer Dabbelt, Wookey.

On Wed, May 16, 2018 at 11:18:45AM +0300, Yury Norov wrote:
> This series enables AARCH64 with ILP32 mode.
> 
> As supporting work, it introduces ARCH_32BIT_OFF_T configuration
> option that is enabled for existing 32-bit architectures but disabled
> for new arches (so 64-bit off_t userspace type is used by new userspace).
> Also it deprecates getrlimit and setrlimit syscalls prior to prlimit64.
> 
> Based on kernel v4.16. Tested with LTP, glibc testsuite, trinity, lmbench,
> CPUSpec.
> 
> This series on github: 
> https://github.com/norov/linux/tree/ilp32-4.16
> Linaro toolchain:
> http://snapshots.linaro.org/components/toolchain/binaries/7.3-2018.04-rc1/aarch64-linux-gnu_ilp32/
> Debian repo:
> http://people.linaro.org/~wookey/ilp32/
> OpenSUSE repo:
> https://build.opensuse.org/project/show/devel:ARM:Factory:Contrib:ILP32
> 
> Changes:
> v3: https://lkml.org/lkml/2014/9/3/704
> v4: https://lkml.org/lkml/2015/4/13/691
> v5: https://lkml.org/lkml/2015/9/29/911
> v6: https://lkml.org/lkml/2016/5/23/661
> v7: https://lkml.org/lkml/2017/1/9/213
> v8: https://lkml.org/lkml/2017/6/19/624
> v9: - rebased on top of v4.16;
>     - signal subsystem reworked to avoid code duplication, as requested
>       by Dave Martin (patches 18 and 20);
>     - new files introduced in series use SPDX notation for license;
>     - linux-api and linux-arch CCed as the series changes kernel ABI;
>     - checkpatch and other minor fixes.
>     - Zhou Chengming's reported-by for patch 2 and signed-off-by for
>       patch 21 removed because his email became invalid. Zhou, please
>       share your new email.

This is the update of the series based on 4.17 kernel
https://github.com/norov/linux/tree/ilp32-4.17
with the following non-critical changes:
 - documentation patch extended with few words about ILP32 in general, and
   the link to ARM document about it added;
 - nds32 and riscv32 exceptions added for ARCH_32BIT_OFF_T and
   {get,set}rlimit (patches 4 and 5).
 - changes to architectures that are unsupported anymore are dropped.
 - Chris Metcalf's ack for patch #3 removed, as it is related to
   tile32 which is unsupported now.

Reminder to Arnd. There's arch subseries acked by you but still
without progress. Could you consider taking it upstream?
[PATCH 03/24] compat ABI: use non-compat openat and open_by_handle_at variants
[PATCH 04/24] 32-bit userspace ABI: introduce ARCH_32BIT_OFF_T config option
[PATCH 05/24] asm-generic: Drop getrlimit and setrlimit syscalls from default list

Yury

^ permalink raw reply	[flat|nested] 104+ messages in thread

* [PATCH v9 00/24] ILP32 for ARM64
@ 2018-05-16  8:18 ` Yury Norov
  0 siblings, 0 replies; 104+ messages in thread
From: Yury Norov @ 2018-05-16  8:18 UTC (permalink / raw)
  To: Catalin Marinas, Arnd Bergmann, linux-arm-kernel, linux-kernel,
	linux-doc, linux-arch, linux-api
  Cc: Yury Norov, Adam Borowski, Alexander Graf, Alexey Klimov,
	Andreas Schwab, Andrew Pinski, Bamvor Zhangjian, Chris Metcalf,
	Christoph Muellner, Dave Martin, David S . Miller,
	Florian Weimer, Geert Uytterhoeven, Heiko Carstens, James Hogan,
	James Morse, Joseph Myers, Lin Yongting, Manuel Montezelo,
	Mark Brown, Martin Schwidefsky, Maxim Kuvyrkov, Nathan_Lynch,
	Philipp Tomsich, Prasun Kapoor, Ramana Radhakrishnan,
	Steve Ellcey, Szabolcs Nagy

This series enables AARCH64 with ILP32 mode.

As supporting work, it introduces ARCH_32BIT_OFF_T configuration
option that is enabled for existing 32-bit architectures but disabled
for new arches (so 64-bit off_t userspace type is used by new userspace).
Also it deprecates getrlimit and setrlimit syscalls prior to prlimit64.

Based on kernel v4.16. Tested with LTP, glibc testsuite, trinity, lmbench,
CPUSpec.

This series on github: 
https://github.com/norov/linux/tree/ilp32-4.16
Linaro toolchain:
http://snapshots.linaro.org/components/toolchain/binaries/7.3-2018.04-rc1/aarch64-linux-gnu_ilp32/
Debian repo:
http://people.linaro.org/~wookey/ilp32/
OpenSUSE repo:
https://build.opensuse.org/project/show/devel:ARM:Factory:Contrib:ILP32

Changes:
v3: https://lkml.org/lkml/2014/9/3/704
v4: https://lkml.org/lkml/2015/4/13/691
v5: https://lkml.org/lkml/2015/9/29/911
v6: https://lkml.org/lkml/2016/5/23/661
v7: https://lkml.org/lkml/2017/1/9/213
v8: https://lkml.org/lkml/2017/6/19/624
v9: - rebased on top of v4.16;
    - signal subsystem reworked to avoid code duplication, as requested
      by Dave Martin (patches 18 and 20);
    - new files introduced in series use SPDX notation for license;
    - linux-api and linux-arch CCed as the series changes kernel ABI;
    - checkpatch and other minor fixes.
    - Zhou Chengming's reported-by for patch 2 and signed-off-by for
      patch 21 removed because his email became invalid. Zhou, please
      share your new email.

Andrew Pinski (4):
  arm64: rename COMPAT to AARCH32_EL0 in Kconfig
  arm64:uapi: set __BITS_PER_LONG correctly for ILP32 and LP64
  arm64: ilp32: add sys_ilp32.c and a separate table (in entry.S) to use
    it
  arm64:ilp32: add ARM64_ILP32 to Kconfig

Catalin Marinas (1):
  arm64: ilp32: Make the Kconfig option default y

Dave Martin (1):
  arm64: signal: Make parse_user_sigframe() independent of rt_sigframe
    layout

James Morse (1):
  ptrace: Add compat PTRACE_{G,S}ETSIGMASK handlers

Philipp Tomsich (1):
  arm64:ilp32: add vdso-ilp32 and use for signal return

Yury Norov (16):
  compat ABI: use non-compat openat and open_by_handle_at variants
  32-bit userspace ABI: introduce ARCH_32BIT_OFF_T config option
  asm-generic: Drop getrlimit and setrlimit syscalls from default list
  thread: move thread bits accessors to separated file
  arm64: ilp32: add documentation on the ILP32 ABI for ARM64
  arm64: rename functions that reference compat term
  arm64: introduce is_a32_task and is_a32_thread (for AArch32 compat)
  arm64: ilp32: add is_ilp32_compat_{task,thread} and TIF_32BIT_AARCH64
  arm64: introduce binfmt_elf32.c
  arm64: change compat_elf_hwcap and compat_elf_hwcap2 prefix to a32
  arm64: ilp32: introduce binfmt_ilp32.c
  arm64: ilp32: share aarch32 syscall handlers
  arm64: signal: share lp64 signal structures and routines to ilp32
  arm64: signal32: move ilp32 and aarch32 common code to separated file
  arm64: ilp32: introduce ilp32-specific sigframe and ucontext
  arm64: ptrace: handle ptrace_request differently for aarch32 and ilp32

 Documentation/arm64/ilp32.txt                 |  45 +++
 arch/Kconfig                                  |  15 +
 arch/arc/Kconfig                              |   1 +
 arch/arc/include/uapi/asm/unistd.h            |   1 +
 arch/arm/Kconfig                              |   1 +
 arch/arm64/Kconfig                            |  18 +-
 arch/arm64/Makefile                           |   3 +
 arch/arm64/include/asm/compat.h               |  19 +-
 arch/arm64/include/asm/elf.h                  |  36 +-
 arch/arm64/include/asm/fpsimd.h               |   2 +-
 arch/arm64/include/asm/ftrace.h               |   2 +-
 arch/arm64/include/asm/hwcap.h                |   8 +-
 arch/arm64/include/asm/is_compat.h            |  78 ++++
 arch/arm64/include/asm/processor.h            |  15 +-
 arch/arm64/include/asm/ptrace.h               |  12 +-
 arch/arm64/include/asm/seccomp.h              |   2 +-
 arch/arm64/include/asm/signal32.h             |  19 +-
 arch/arm64/include/asm/signal32_common.h      |  13 +
 arch/arm64/include/asm/signal_common.h        | 306 +++++++++++++++
 arch/arm64/include/asm/signal_ilp32.h         |  23 ++
 arch/arm64/include/asm/syscall.h              |   2 +-
 arch/arm64/include/asm/thread_info.h          |   4 +-
 arch/arm64/include/asm/unistd.h               |   6 +-
 arch/arm64/include/asm/vdso.h                 |   6 +
 arch/arm64/include/uapi/asm/bitsperlong.h     |   9 +-
 arch/arm64/include/uapi/asm/unistd.h          |  13 +
 arch/arm64/kernel/Makefile                    |   8 +-
 arch/arm64/kernel/armv8_deprecated.c          |   6 +-
 arch/arm64/kernel/asm-offsets.c               |   9 +-
 arch/arm64/kernel/binfmt_elf32.c              |  35 ++
 arch/arm64/kernel/binfmt_ilp32.c              |  87 +++++
 arch/arm64/kernel/cpufeature.c                |  28 +-
 arch/arm64/kernel/cpuinfo.c                   |  18 +-
 arch/arm64/kernel/debug-monitors.c            |   4 +-
 arch/arm64/kernel/entry.S                     |  37 +-
 arch/arm64/kernel/entry32.S                   |  80 ----
 arch/arm64/kernel/entry32_common.S            |  97 +++++
 arch/arm64/kernel/entry_ilp32.S               |  12 +
 arch/arm64/kernel/head.S                      |   2 +-
 arch/arm64/kernel/hw_breakpoint.c             |   8 +-
 arch/arm64/kernel/perf_callchain.c            |  28 +-
 arch/arm64/kernel/perf_regs.c                 |   4 +-
 arch/arm64/kernel/process.c                   |  11 +-
 arch/arm64/kernel/ptrace.c                    |  36 +-
 arch/arm64/kernel/signal.c                    | 352 +++---------------
 arch/arm64/kernel/signal32.c                  | 111 +++---
 arch/arm64/kernel/signal32_common.c           |  37 ++
 arch/arm64/kernel/signal_ilp32.c              |  65 ++++
 arch/arm64/kernel/sys_compat.c                |  10 +-
 arch/arm64/kernel/sys_ilp32.c                 |  90 +++++
 arch/arm64/kernel/traps.c                     |  11 +-
 arch/arm64/kernel/vdso-ilp32/.gitignore       |   2 +
 arch/arm64/kernel/vdso-ilp32/Makefile         |  82 ++++
 arch/arm64/kernel/vdso-ilp32/vdso-ilp32.S     |  22 ++
 arch/arm64/kernel/vdso-ilp32/vdso-ilp32.lds.S |  84 +++++
 arch/arm64/kernel/vdso.c                      |  65 +++-
 arch/arm64/kernel/vdso/gettimeofday.S         |  20 +-
 arch/arm64/kernel/vdso/vdso.S                 |   6 +-
 arch/arm64/mm/mmap.c                          |   2 +-
 arch/blackfin/Kconfig                         |   1 +
 arch/c6x/include/uapi/asm/unistd.h            |   1 +
 arch/cris/Kconfig                             |   1 +
 arch/frv/Kconfig                              |   1 +
 arch/h8300/Kconfig                            |   1 +
 arch/h8300/include/uapi/asm/unistd.h          |   1 +
 arch/hexagon/Kconfig                          |   1 +
 arch/hexagon/include/uapi/asm/unistd.h        |   1 +
 arch/m32r/Kconfig                             |   1 +
 arch/m68k/Kconfig                             |   1 +
 arch/metag/Kconfig                            |   1 +
 arch/metag/include/uapi/asm/unistd.h          |   1 +
 arch/microblaze/Kconfig                       |   1 +
 arch/mips/Kconfig                             |   1 +
 arch/mn10300/Kconfig                          |   1 +
 arch/nios2/Kconfig                            |   1 +
 arch/nios2/include/uapi/asm/unistd.h          |   1 +
 arch/openrisc/Kconfig                         |   1 +
 arch/openrisc/include/uapi/asm/unistd.h       |   1 +
 arch/parisc/Kconfig                           |   1 +
 arch/powerpc/Kconfig                          |   1 +
 arch/score/Kconfig                            |   1 +
 arch/score/include/uapi/asm/unistd.h          |   1 +
 arch/sh/Kconfig                               |   1 +
 arch/sparc/Kconfig                            |   1 +
 arch/tile/Kconfig                             |   1 +
 arch/tile/include/uapi/asm/unistd.h           |   1 +
 arch/tile/kernel/compat.c                     |   3 +
 arch/unicore32/Kconfig                        |   1 +
 arch/unicore32/include/uapi/asm/unistd.h      |   1 +
 arch/x86/Kconfig                              |   1 +
 arch/x86/um/Kconfig                           |   1 +
 arch/xtensa/Kconfig                           |   1 +
 drivers/clocksource/arm_arch_timer.c          |   4 +-
 include/linux/fcntl.h                         |   2 +-
 include/linux/sched.h                         |   1 +
 include/linux/thread_bits.h                   |  76 ++++
 include/linux/thread_info.h                   |  64 +---
 include/uapi/asm-generic/unistd.h             |  10 +-
 kernel/ptrace.c                               |  48 ++-
 scripts/checksyscalls.sh                      |   5 +
 100 files changed, 1675 insertions(+), 698 deletions(-)
 create mode 100644 Documentation/arm64/ilp32.txt
 create mode 100644 arch/arm64/include/asm/is_compat.h
 create mode 100644 arch/arm64/include/asm/signal32_common.h
 create mode 100644 arch/arm64/include/asm/signal_common.h
 create mode 100644 arch/arm64/include/asm/signal_ilp32.h
 create mode 100644 arch/arm64/kernel/binfmt_elf32.c
 create mode 100644 arch/arm64/kernel/binfmt_ilp32.c
 create mode 100644 arch/arm64/kernel/entry32_common.S
 create mode 100644 arch/arm64/kernel/entry_ilp32.S
 create mode 100644 arch/arm64/kernel/signal32_common.c
 create mode 100644 arch/arm64/kernel/signal_ilp32.c
 create mode 100644 arch/arm64/kernel/sys_ilp32.c
 create mode 100644 arch/arm64/kernel/vdso-ilp32/.gitignore
 create mode 100644 arch/arm64/kernel/vdso-ilp32/Makefile
 create mode 100644 arch/arm64/kernel/vdso-ilp32/vdso-ilp32.S
 create mode 100644 arch/arm64/kernel/vdso-ilp32/vdso-ilp32.lds.S
 create mode 100644 include/linux/thread_bits.h

-- 
2.17.0


^ permalink raw reply	[flat|nested] 104+ messages in thread

* [PATCH v9 00/24] ILP32 for ARM64
@ 2018-05-16  8:18 ` Yury Norov
  0 siblings, 0 replies; 104+ messages in thread
From: Yury Norov @ 2018-05-16  8:18 UTC (permalink / raw)
  To: Catalin Marinas, Arnd Bergmann, linux-arm-kernel, linux-kernel,
	linux-doc, linux-arch, linux-api
  Cc: Yury Norov, Adam Borowski, Alexander Graf, Alexey Klimov,
	Andreas Schwab, Andrew Pinski, Bamvor Zhangjian, Chris Metcalf,
	Christoph Muellner, Dave Martin, David S . Miller,
	Florian Weimer, Geert Uytterhoeven, Heiko Carstens, James Hogan,
	James Morse, Joseph Myers, Lin Yongting, Manuel Montezelo,
	Mark Brown, Martin Schwidefsky, Maxim Kuvyrkov, Nathan_Lynch,
	Philipp Tomsich, Prasun Kapoor, Ramana Radhakrishnan,
	Steve Ellcey, Szabolcs Nagy

This series enables AARCH64 with ILP32 mode.

As supporting work, it introduces ARCH_32BIT_OFF_T configuration
option that is enabled for existing 32-bit architectures but disabled
for new arches (so 64-bit off_t userspace type is used by new userspace).
Also it deprecates getrlimit and setrlimit syscalls prior to prlimit64.

Based on kernel v4.16. Tested with LTP, glibc testsuite, trinity, lmbench,
CPUSpec.

This series on github: 
https://github.com/norov/linux/tree/ilp32-4.16
Linaro toolchain:
http://snapshots.linaro.org/components/toolchain/binaries/7.3-2018.04-rc1/aarch64-linux-gnu_ilp32/
Debian repo:
http://people.linaro.org/~wookey/ilp32/
OpenSUSE repo:
https://build.opensuse.org/project/show/devel:ARM:Factory:Contrib:ILP32

Changes:
v3: https://lkml.org/lkml/2014/9/3/704
v4: https://lkml.org/lkml/2015/4/13/691
v5: https://lkml.org/lkml/2015/9/29/911
v6: https://lkml.org/lkml/2016/5/23/661
v7: https://lkml.org/lkml/2017/1/9/213
v8: https://lkml.org/lkml/2017/6/19/624
v9: - rebased on top of v4.16;
    - signal subsystem reworked to avoid code duplication, as requested
      by Dave Martin (patches 18 and 20);
    - new files introduced in series use SPDX notation for license;
    - linux-api and linux-arch CCed as the series changes kernel ABI;
    - checkpatch and other minor fixes.
    - Zhou Chengming's reported-by for patch 2 and signed-off-by for
      patch 21 removed because his email became invalid. Zhou, please
      share your new email.

Andrew Pinski (4):
  arm64: rename COMPAT to AARCH32_EL0 in Kconfig
  arm64:uapi: set __BITS_PER_LONG correctly for ILP32 and LP64
  arm64: ilp32: add sys_ilp32.c and a separate table (in entry.S) to use
    it
  arm64:ilp32: add ARM64_ILP32 to Kconfig

Catalin Marinas (1):
  arm64: ilp32: Make the Kconfig option default y

Dave Martin (1):
  arm64: signal: Make parse_user_sigframe() independent of rt_sigframe
    layout

James Morse (1):
  ptrace: Add compat PTRACE_{G,S}ETSIGMASK handlers

Philipp Tomsich (1):
  arm64:ilp32: add vdso-ilp32 and use for signal return

Yury Norov (16):
  compat ABI: use non-compat openat and open_by_handle_at variants
  32-bit userspace ABI: introduce ARCH_32BIT_OFF_T config option
  asm-generic: Drop getrlimit and setrlimit syscalls from default list
  thread: move thread bits accessors to separated file
  arm64: ilp32: add documentation on the ILP32 ABI for ARM64
  arm64: rename functions that reference compat term
  arm64: introduce is_a32_task and is_a32_thread (for AArch32 compat)
  arm64: ilp32: add is_ilp32_compat_{task,thread} and TIF_32BIT_AARCH64
  arm64: introduce binfmt_elf32.c
  arm64: change compat_elf_hwcap and compat_elf_hwcap2 prefix to a32
  arm64: ilp32: introduce binfmt_ilp32.c
  arm64: ilp32: share aarch32 syscall handlers
  arm64: signal: share lp64 signal structures and routines to ilp32
  arm64: signal32: move ilp32 and aarch32 common code to separated file
  arm64: ilp32: introduce ilp32-specific sigframe and ucontext
  arm64: ptrace: handle ptrace_request differently for aarch32 and ilp32

 Documentation/arm64/ilp32.txt                 |  45 +++
 arch/Kconfig                                  |  15 +
 arch/arc/Kconfig                              |   1 +
 arch/arc/include/uapi/asm/unistd.h            |   1 +
 arch/arm/Kconfig                              |   1 +
 arch/arm64/Kconfig                            |  18 +-
 arch/arm64/Makefile                           |   3 +
 arch/arm64/include/asm/compat.h               |  19 +-
 arch/arm64/include/asm/elf.h                  |  36 +-
 arch/arm64/include/asm/fpsimd.h               |   2 +-
 arch/arm64/include/asm/ftrace.h               |   2 +-
 arch/arm64/include/asm/hwcap.h                |   8 +-
 arch/arm64/include/asm/is_compat.h            |  78 ++++
 arch/arm64/include/asm/processor.h            |  15 +-
 arch/arm64/include/asm/ptrace.h               |  12 +-
 arch/arm64/include/asm/seccomp.h              |   2 +-
 arch/arm64/include/asm/signal32.h             |  19 +-
 arch/arm64/include/asm/signal32_common.h      |  13 +
 arch/arm64/include/asm/signal_common.h        | 306 +++++++++++++++
 arch/arm64/include/asm/signal_ilp32.h         |  23 ++
 arch/arm64/include/asm/syscall.h              |   2 +-
 arch/arm64/include/asm/thread_info.h          |   4 +-
 arch/arm64/include/asm/unistd.h               |   6 +-
 arch/arm64/include/asm/vdso.h                 |   6 +
 arch/arm64/include/uapi/asm/bitsperlong.h     |   9 +-
 arch/arm64/include/uapi/asm/unistd.h          |  13 +
 arch/arm64/kernel/Makefile                    |   8 +-
 arch/arm64/kernel/armv8_deprecated.c          |   6 +-
 arch/arm64/kernel/asm-offsets.c               |   9 +-
 arch/arm64/kernel/binfmt_elf32.c              |  35 ++
 arch/arm64/kernel/binfmt_ilp32.c              |  87 +++++
 arch/arm64/kernel/cpufeature.c                |  28 +-
 arch/arm64/kernel/cpuinfo.c                   |  18 +-
 arch/arm64/kernel/debug-monitors.c            |   4 +-
 arch/arm64/kernel/entry.S                     |  37 +-
 arch/arm64/kernel/entry32.S                   |  80 ----
 arch/arm64/kernel/entry32_common.S            |  97 +++++
 arch/arm64/kernel/entry_ilp32.S               |  12 +
 arch/arm64/kernel/head.S                      |   2 +-
 arch/arm64/kernel/hw_breakpoint.c             |   8 +-
 arch/arm64/kernel/perf_callchain.c            |  28 +-
 arch/arm64/kernel/perf_regs.c                 |   4 +-
 arch/arm64/kernel/process.c                   |  11 +-
 arch/arm64/kernel/ptrace.c                    |  36 +-
 arch/arm64/kernel/signal.c                    | 352 +++---------------
 arch/arm64/kernel/signal32.c                  | 111 +++---
 arch/arm64/kernel/signal32_common.c           |  37 ++
 arch/arm64/kernel/signal_ilp32.c              |  65 ++++
 arch/arm64/kernel/sys_compat.c                |  10 +-
 arch/arm64/kernel/sys_ilp32.c                 |  90 +++++
 arch/arm64/kernel/traps.c                     |  11 +-
 arch/arm64/kernel/vdso-ilp32/.gitignore       |   2 +
 arch/arm64/kernel/vdso-ilp32/Makefile         |  82 ++++
 arch/arm64/kernel/vdso-ilp32/vdso-ilp32.S     |  22 ++
 arch/arm64/kernel/vdso-ilp32/vdso-ilp32.lds.S |  84 +++++
 arch/arm64/kernel/vdso.c                      |  65 +++-
 arch/arm64/kernel/vdso/gettimeofday.S         |  20 +-
 arch/arm64/kernel/vdso/vdso.S                 |   6 +-
 arch/arm64/mm/mmap.c                          |   2 +-
 arch/blackfin/Kconfig                         |   1 +
 arch/c6x/include/uapi/asm/unistd.h            |   1 +
 arch/cris/Kconfig                             |   1 +
 arch/frv/Kconfig                              |   1 +
 arch/h8300/Kconfig                            |   1 +
 arch/h8300/include/uapi/asm/unistd.h          |   1 +
 arch/hexagon/Kconfig                          |   1 +
 arch/hexagon/include/uapi/asm/unistd.h        |   1 +
 arch/m32r/Kconfig                             |   1 +
 arch/m68k/Kconfig                             |   1 +
 arch/metag/Kconfig                            |   1 +
 arch/metag/include/uapi/asm/unistd.h          |   1 +
 arch/microblaze/Kconfig                       |   1 +
 arch/mips/Kconfig                             |   1 +
 arch/mn10300/Kconfig                          |   1 +
 arch/nios2/Kconfig                            |   1 +
 arch/nios2/include/uapi/asm/unistd.h          |   1 +
 arch/openrisc/Kconfig                         |   1 +
 arch/openrisc/include/uapi/asm/unistd.h       |   1 +
 arch/parisc/Kconfig                           |   1 +
 arch/powerpc/Kconfig                          |   1 +
 arch/score/Kconfig                            |   1 +
 arch/score/include/uapi/asm/unistd.h          |   1 +
 arch/sh/Kconfig                               |   1 +
 arch/sparc/Kconfig                            |   1 +
 arch/tile/Kconfig                             |   1 +
 arch/tile/include/uapi/asm/unistd.h           |   1 +
 arch/tile/kernel/compat.c                     |   3 +
 arch/unicore32/Kconfig                        |   1 +
 arch/unicore32/include/uapi/asm/unistd.h      |   1 +
 arch/x86/Kconfig                              |   1 +
 arch/x86/um/Kconfig                           |   1 +
 arch/xtensa/Kconfig                           |   1 +
 drivers/clocksource/arm_arch_timer.c          |   4 +-
 include/linux/fcntl.h                         |   2 +-
 include/linux/sched.h                         |   1 +
 include/linux/thread_bits.h                   |  76 ++++
 include/linux/thread_info.h                   |  64 +---
 include/uapi/asm-generic/unistd.h             |  10 +-
 kernel/ptrace.c                               |  48 ++-
 scripts/checksyscalls.sh                      |   5 +
 100 files changed, 1675 insertions(+), 698 deletions(-)
 create mode 100644 Documentation/arm64/ilp32.txt
 create mode 100644 arch/arm64/include/asm/is_compat.h
 create mode 100644 arch/arm64/include/asm/signal32_common.h
 create mode 100644 arch/arm64/include/asm/signal_common.h
 create mode 100644 arch/arm64/include/asm/signal_ilp32.h
 create mode 100644 arch/arm64/kernel/binfmt_elf32.c
 create mode 100644 arch/arm64/kernel/binfmt_ilp32.c
 create mode 100644 arch/arm64/kernel/entry32_common.S
 create mode 100644 arch/arm64/kernel/entry_ilp32.S
 create mode 100644 arch/arm64/kernel/signal32_common.c
 create mode 100644 arch/arm64/kernel/signal_ilp32.c
 create mode 100644 arch/arm64/kernel/sys_ilp32.c
 create mode 100644 arch/arm64/kernel/vdso-ilp32/.gitignore
 create mode 100644 arch/arm64/kernel/vdso-ilp32/Makefile
 create mode 100644 arch/arm64/kernel/vdso-ilp32/vdso-ilp32.S
 create mode 100644 arch/arm64/kernel/vdso-ilp32/vdso-ilp32.lds.S
 create mode 100644 include/linux/thread_bits.h

-- 
2.17.0

--
To unsubscribe from this list: send the line "unsubscribe linux-doc" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 104+ messages in thread

* [PATCH v9 00/24] ILP32 for ARM64
@ 2018-05-16  8:18 ` Yury Norov
  0 siblings, 0 replies; 104+ messages in thread
From: Yury Norov @ 2018-05-16  8:18 UTC (permalink / raw)
  To: Catalin Marinas, Arnd Bergmann, linux-arm-kernel, linux-kernel,
	linux-doc, linux-arch, linux-api
  Cc: Yury Norov, Adam Borowski, Alexander Graf, Alexey Klimov,
	Andreas Schwab, Andrew Pinski, Bamvor Zhangjian, Chris Metcalf,
	Christoph Muellner, Dave Martin, David S . Miller,
	Florian Weimer, Geert Uytterhoeven, Heiko Carstens, James Hogan,
	James Morse, Joseph Myers, Lin Yongting, Manuel Montezelo

This series enables AARCH64 with ILP32 mode.

As supporting work, it introduces ARCH_32BIT_OFF_T configuration
option that is enabled for existing 32-bit architectures but disabled
for new arches (so 64-bit off_t userspace type is used by new userspace).
Also it deprecates getrlimit and setrlimit syscalls prior to prlimit64.

Based on kernel v4.16. Tested with LTP, glibc testsuite, trinity, lmbench,
CPUSpec.

This series on github: 
https://github.com/norov/linux/tree/ilp32-4.16
Linaro toolchain:
http://snapshots.linaro.org/components/toolchain/binaries/7.3-2018.04-rc1/aarch64-linux-gnu_ilp32/
Debian repo:
http://people.linaro.org/~wookey/ilp32/
OpenSUSE repo:
https://build.opensuse.org/project/show/devel:ARM:Factory:Contrib:ILP32

Changes:
v3: https://lkml.org/lkml/2014/9/3/704
v4: https://lkml.org/lkml/2015/4/13/691
v5: https://lkml.org/lkml/2015/9/29/911
v6: https://lkml.org/lkml/2016/5/23/661
v7: https://lkml.org/lkml/2017/1/9/213
v8: https://lkml.org/lkml/2017/6/19/624
v9: - rebased on top of v4.16;
    - signal subsystem reworked to avoid code duplication, as requested
      by Dave Martin (patches 18 and 20);
    - new files introduced in series use SPDX notation for license;
    - linux-api and linux-arch CCed as the series changes kernel ABI;
    - checkpatch and other minor fixes.
    - Zhou Chengming's reported-by for patch 2 and signed-off-by for
      patch 21 removed because his email became invalid. Zhou, please
      share your new email.

Andrew Pinski (4):
  arm64: rename COMPAT to AARCH32_EL0 in Kconfig
  arm64:uapi: set __BITS_PER_LONG correctly for ILP32 and LP64
  arm64: ilp32: add sys_ilp32.c and a separate table (in entry.S) to use
    it
  arm64:ilp32: add ARM64_ILP32 to Kconfig

Catalin Marinas (1):
  arm64: ilp32: Make the Kconfig option default y

Dave Martin (1):
  arm64: signal: Make parse_user_sigframe() independent of rt_sigframe
    layout

James Morse (1):
  ptrace: Add compat PTRACE_{G,S}ETSIGMASK handlers

Philipp Tomsich (1):
  arm64:ilp32: add vdso-ilp32 and use for signal return

Yury Norov (16):
  compat ABI: use non-compat openat and open_by_handle_at variants
  32-bit userspace ABI: introduce ARCH_32BIT_OFF_T config option
  asm-generic: Drop getrlimit and setrlimit syscalls from default list
  thread: move thread bits accessors to separated file
  arm64: ilp32: add documentation on the ILP32 ABI for ARM64
  arm64: rename functions that reference compat term
  arm64: introduce is_a32_task and is_a32_thread (for AArch32 compat)
  arm64: ilp32: add is_ilp32_compat_{task,thread} and TIF_32BIT_AARCH64
  arm64: introduce binfmt_elf32.c
  arm64: change compat_elf_hwcap and compat_elf_hwcap2 prefix to a32
  arm64: ilp32: introduce binfmt_ilp32.c
  arm64: ilp32: share aarch32 syscall handlers
  arm64: signal: share lp64 signal structures and routines to ilp32
  arm64: signal32: move ilp32 and aarch32 common code to separated file
  arm64: ilp32: introduce ilp32-specific sigframe and ucontext
  arm64: ptrace: handle ptrace_request differently for aarch32 and ilp32

 Documentation/arm64/ilp32.txt                 |  45 +++
 arch/Kconfig                                  |  15 +
 arch/arc/Kconfig                              |   1 +
 arch/arc/include/uapi/asm/unistd.h            |   1 +
 arch/arm/Kconfig                              |   1 +
 arch/arm64/Kconfig                            |  18 +-
 arch/arm64/Makefile                           |   3 +
 arch/arm64/include/asm/compat.h               |  19 +-
 arch/arm64/include/asm/elf.h                  |  36 +-
 arch/arm64/include/asm/fpsimd.h               |   2 +-
 arch/arm64/include/asm/ftrace.h               |   2 +-
 arch/arm64/include/asm/hwcap.h                |   8 +-
 arch/arm64/include/asm/is_compat.h            |  78 ++++
 arch/arm64/include/asm/processor.h            |  15 +-
 arch/arm64/include/asm/ptrace.h               |  12 +-
 arch/arm64/include/asm/seccomp.h              |   2 +-
 arch/arm64/include/asm/signal32.h             |  19 +-
 arch/arm64/include/asm/signal32_common.h      |  13 +
 arch/arm64/include/asm/signal_common.h        | 306 +++++++++++++++
 arch/arm64/include/asm/signal_ilp32.h         |  23 ++
 arch/arm64/include/asm/syscall.h              |   2 +-
 arch/arm64/include/asm/thread_info.h          |   4 +-
 arch/arm64/include/asm/unistd.h               |   6 +-
 arch/arm64/include/asm/vdso.h                 |   6 +
 arch/arm64/include/uapi/asm/bitsperlong.h     |   9 +-
 arch/arm64/include/uapi/asm/unistd.h          |  13 +
 arch/arm64/kernel/Makefile                    |   8 +-
 arch/arm64/kernel/armv8_deprecated.c          |   6 +-
 arch/arm64/kernel/asm-offsets.c               |   9 +-
 arch/arm64/kernel/binfmt_elf32.c              |  35 ++
 arch/arm64/kernel/binfmt_ilp32.c              |  87 +++++
 arch/arm64/kernel/cpufeature.c                |  28 +-
 arch/arm64/kernel/cpuinfo.c                   |  18 +-
 arch/arm64/kernel/debug-monitors.c            |   4 +-
 arch/arm64/kernel/entry.S                     |  37 +-
 arch/arm64/kernel/entry32.S                   |  80 ----
 arch/arm64/kernel/entry32_common.S            |  97 +++++
 arch/arm64/kernel/entry_ilp32.S               |  12 +
 arch/arm64/kernel/head.S                      |   2 +-
 arch/arm64/kernel/hw_breakpoint.c             |   8 +-
 arch/arm64/kernel/perf_callchain.c            |  28 +-
 arch/arm64/kernel/perf_regs.c                 |   4 +-
 arch/arm64/kernel/process.c                   |  11 +-
 arch/arm64/kernel/ptrace.c                    |  36 +-
 arch/arm64/kernel/signal.c                    | 352 +++---------------
 arch/arm64/kernel/signal32.c                  | 111 +++---
 arch/arm64/kernel/signal32_common.c           |  37 ++
 arch/arm64/kernel/signal_ilp32.c              |  65 ++++
 arch/arm64/kernel/sys_compat.c                |  10 +-
 arch/arm64/kernel/sys_ilp32.c                 |  90 +++++
 arch/arm64/kernel/traps.c                     |  11 +-
 arch/arm64/kernel/vdso-ilp32/.gitignore       |   2 +
 arch/arm64/kernel/vdso-ilp32/Makefile         |  82 ++++
 arch/arm64/kernel/vdso-ilp32/vdso-ilp32.S     |  22 ++
 arch/arm64/kernel/vdso-ilp32/vdso-ilp32.lds.S |  84 +++++
 arch/arm64/kernel/vdso.c                      |  65 +++-
 arch/arm64/kernel/vdso/gettimeofday.S         |  20 +-
 arch/arm64/kernel/vdso/vdso.S                 |   6 +-
 arch/arm64/mm/mmap.c                          |   2 +-
 arch/blackfin/Kconfig                         |   1 +
 arch/c6x/include/uapi/asm/unistd.h            |   1 +
 arch/cris/Kconfig                             |   1 +
 arch/frv/Kconfig                              |   1 +
 arch/h8300/Kconfig                            |   1 +
 arch/h8300/include/uapi/asm/unistd.h          |   1 +
 arch/hexagon/Kconfig                          |   1 +
 arch/hexagon/include/uapi/asm/unistd.h        |   1 +
 arch/m32r/Kconfig                             |   1 +
 arch/m68k/Kconfig                             |   1 +
 arch/metag/Kconfig                            |   1 +
 arch/metag/include/uapi/asm/unistd.h          |   1 +
 arch/microblaze/Kconfig                       |   1 +
 arch/mips/Kconfig                             |   1 +
 arch/mn10300/Kconfig                          |   1 +
 arch/nios2/Kconfig                            |   1 +
 arch/nios2/include/uapi/asm/unistd.h          |   1 +
 arch/openrisc/Kconfig                         |   1 +
 arch/openrisc/include/uapi/asm/unistd.h       |   1 +
 arch/parisc/Kconfig                           |   1 +
 arch/powerpc/Kconfig                          |   1 +
 arch/score/Kconfig                            |   1 +
 arch/score/include/uapi/asm/unistd.h          |   1 +
 arch/sh/Kconfig                               |   1 +
 arch/sparc/Kconfig                            |   1 +
 arch/tile/Kconfig                             |   1 +
 arch/tile/include/uapi/asm/unistd.h           |   1 +
 arch/tile/kernel/compat.c                     |   3 +
 arch/unicore32/Kconfig                        |   1 +
 arch/unicore32/include/uapi/asm/unistd.h      |   1 +
 arch/x86/Kconfig                              |   1 +
 arch/x86/um/Kconfig                           |   1 +
 arch/xtensa/Kconfig                           |   1 +
 drivers/clocksource/arm_arch_timer.c          |   4 +-
 include/linux/fcntl.h                         |   2 +-
 include/linux/sched.h                         |   1 +
 include/linux/thread_bits.h                   |  76 ++++
 include/linux/thread_info.h                   |  64 +---
 include/uapi/asm-generic/unistd.h             |  10 +-
 kernel/ptrace.c                               |  48 ++-
 scripts/checksyscalls.sh                      |   5 +
 100 files changed, 1675 insertions(+), 698 deletions(-)
 create mode 100644 Documentation/arm64/ilp32.txt
 create mode 100644 arch/arm64/include/asm/is_compat.h
 create mode 100644 arch/arm64/include/asm/signal32_common.h
 create mode 100644 arch/arm64/include/asm/signal_common.h
 create mode 100644 arch/arm64/include/asm/signal_ilp32.h
 create mode 100644 arch/arm64/kernel/binfmt_elf32.c
 create mode 100644 arch/arm64/kernel/binfmt_ilp32.c
 create mode 100644 arch/arm64/kernel/entry32_common.S
 create mode 100644 arch/arm64/kernel/entry_ilp32.S
 create mode 100644 arch/arm64/kernel/signal32_common.c
 create mode 100644 arch/arm64/kernel/signal_ilp32.c
 create mode 100644 arch/arm64/kernel/sys_ilp32.c
 create mode 100644 arch/arm64/kernel/vdso-ilp32/.gitignore
 create mode 100644 arch/arm64/kernel/vdso-ilp32/Makefile
 create mode 100644 arch/arm64/kernel/vdso-ilp32/vdso-ilp32.S
 create mode 100644 arch/arm64/kernel/vdso-ilp32/vdso-ilp32.lds.S
 create mode 100644 include/linux/thread_bits.h

-- 
2.17.0

^ permalink raw reply	[flat|nested] 104+ messages in thread

* [PATCH v9 00/24] ILP32 for ARM64
@ 2018-05-16  8:18 ` Yury Norov
  0 siblings, 0 replies; 104+ messages in thread
From: Yury Norov @ 2018-05-16  8:18 UTC (permalink / raw)
  To: linux-arm-kernel

This series enables AARCH64 with ILP32 mode.

As supporting work, it introduces ARCH_32BIT_OFF_T configuration
option that is enabled for existing 32-bit architectures but disabled
for new arches (so 64-bit off_t userspace type is used by new userspace).
Also it deprecates getrlimit and setrlimit syscalls prior to prlimit64.

Based on kernel v4.16. Tested with LTP, glibc testsuite, trinity, lmbench,
CPUSpec.

This series on github: 
https://github.com/norov/linux/tree/ilp32-4.16
Linaro toolchain:
http://snapshots.linaro.org/components/toolchain/binaries/7.3-2018.04-rc1/aarch64-linux-gnu_ilp32/
Debian repo:
http://people.linaro.org/~wookey/ilp32/
OpenSUSE repo:
https://build.opensuse.org/project/show/devel:ARM:Factory:Contrib:ILP32

Changes:
v3: https://lkml.org/lkml/2014/9/3/704
v4: https://lkml.org/lkml/2015/4/13/691
v5: https://lkml.org/lkml/2015/9/29/911
v6: https://lkml.org/lkml/2016/5/23/661
v7: https://lkml.org/lkml/2017/1/9/213
v8: https://lkml.org/lkml/2017/6/19/624
v9: - rebased on top of v4.16;
    - signal subsystem reworked to avoid code duplication, as requested
      by Dave Martin (patches 18 and 20);
    - new files introduced in series use SPDX notation for license;
    - linux-api and linux-arch CCed as the series changes kernel ABI;
    - checkpatch and other minor fixes.
    - Zhou Chengming's reported-by for patch 2 and signed-off-by for
      patch 21 removed because his email became invalid. Zhou, please
      share your new email.

Andrew Pinski (4):
  arm64: rename COMPAT to AARCH32_EL0 in Kconfig
  arm64:uapi: set __BITS_PER_LONG correctly for ILP32 and LP64
  arm64: ilp32: add sys_ilp32.c and a separate table (in entry.S) to use
    it
  arm64:ilp32: add ARM64_ILP32 to Kconfig

Catalin Marinas (1):
  arm64: ilp32: Make the Kconfig option default y

Dave Martin (1):
  arm64: signal: Make parse_user_sigframe() independent of rt_sigframe
    layout

James Morse (1):
  ptrace: Add compat PTRACE_{G,S}ETSIGMASK handlers

Philipp Tomsich (1):
  arm64:ilp32: add vdso-ilp32 and use for signal return

Yury Norov (16):
  compat ABI: use non-compat openat and open_by_handle_at variants
  32-bit userspace ABI: introduce ARCH_32BIT_OFF_T config option
  asm-generic: Drop getrlimit and setrlimit syscalls from default list
  thread: move thread bits accessors to separated file
  arm64: ilp32: add documentation on the ILP32 ABI for ARM64
  arm64: rename functions that reference compat term
  arm64: introduce is_a32_task and is_a32_thread (for AArch32 compat)
  arm64: ilp32: add is_ilp32_compat_{task,thread} and TIF_32BIT_AARCH64
  arm64: introduce binfmt_elf32.c
  arm64: change compat_elf_hwcap and compat_elf_hwcap2 prefix to a32
  arm64: ilp32: introduce binfmt_ilp32.c
  arm64: ilp32: share aarch32 syscall handlers
  arm64: signal: share lp64 signal structures and routines to ilp32
  arm64: signal32: move ilp32 and aarch32 common code to separated file
  arm64: ilp32: introduce ilp32-specific sigframe and ucontext
  arm64: ptrace: handle ptrace_request differently for aarch32 and ilp32

 Documentation/arm64/ilp32.txt                 |  45 +++
 arch/Kconfig                                  |  15 +
 arch/arc/Kconfig                              |   1 +
 arch/arc/include/uapi/asm/unistd.h            |   1 +
 arch/arm/Kconfig                              |   1 +
 arch/arm64/Kconfig                            |  18 +-
 arch/arm64/Makefile                           |   3 +
 arch/arm64/include/asm/compat.h               |  19 +-
 arch/arm64/include/asm/elf.h                  |  36 +-
 arch/arm64/include/asm/fpsimd.h               |   2 +-
 arch/arm64/include/asm/ftrace.h               |   2 +-
 arch/arm64/include/asm/hwcap.h                |   8 +-
 arch/arm64/include/asm/is_compat.h            |  78 ++++
 arch/arm64/include/asm/processor.h            |  15 +-
 arch/arm64/include/asm/ptrace.h               |  12 +-
 arch/arm64/include/asm/seccomp.h              |   2 +-
 arch/arm64/include/asm/signal32.h             |  19 +-
 arch/arm64/include/asm/signal32_common.h      |  13 +
 arch/arm64/include/asm/signal_common.h        | 306 +++++++++++++++
 arch/arm64/include/asm/signal_ilp32.h         |  23 ++
 arch/arm64/include/asm/syscall.h              |   2 +-
 arch/arm64/include/asm/thread_info.h          |   4 +-
 arch/arm64/include/asm/unistd.h               |   6 +-
 arch/arm64/include/asm/vdso.h                 |   6 +
 arch/arm64/include/uapi/asm/bitsperlong.h     |   9 +-
 arch/arm64/include/uapi/asm/unistd.h          |  13 +
 arch/arm64/kernel/Makefile                    |   8 +-
 arch/arm64/kernel/armv8_deprecated.c          |   6 +-
 arch/arm64/kernel/asm-offsets.c               |   9 +-
 arch/arm64/kernel/binfmt_elf32.c              |  35 ++
 arch/arm64/kernel/binfmt_ilp32.c              |  87 +++++
 arch/arm64/kernel/cpufeature.c                |  28 +-
 arch/arm64/kernel/cpuinfo.c                   |  18 +-
 arch/arm64/kernel/debug-monitors.c            |   4 +-
 arch/arm64/kernel/entry.S                     |  37 +-
 arch/arm64/kernel/entry32.S                   |  80 ----
 arch/arm64/kernel/entry32_common.S            |  97 +++++
 arch/arm64/kernel/entry_ilp32.S               |  12 +
 arch/arm64/kernel/head.S                      |   2 +-
 arch/arm64/kernel/hw_breakpoint.c             |   8 +-
 arch/arm64/kernel/perf_callchain.c            |  28 +-
 arch/arm64/kernel/perf_regs.c                 |   4 +-
 arch/arm64/kernel/process.c                   |  11 +-
 arch/arm64/kernel/ptrace.c                    |  36 +-
 arch/arm64/kernel/signal.c                    | 352 +++---------------
 arch/arm64/kernel/signal32.c                  | 111 +++---
 arch/arm64/kernel/signal32_common.c           |  37 ++
 arch/arm64/kernel/signal_ilp32.c              |  65 ++++
 arch/arm64/kernel/sys_compat.c                |  10 +-
 arch/arm64/kernel/sys_ilp32.c                 |  90 +++++
 arch/arm64/kernel/traps.c                     |  11 +-
 arch/arm64/kernel/vdso-ilp32/.gitignore       |   2 +
 arch/arm64/kernel/vdso-ilp32/Makefile         |  82 ++++
 arch/arm64/kernel/vdso-ilp32/vdso-ilp32.S     |  22 ++
 arch/arm64/kernel/vdso-ilp32/vdso-ilp32.lds.S |  84 +++++
 arch/arm64/kernel/vdso.c                      |  65 +++-
 arch/arm64/kernel/vdso/gettimeofday.S         |  20 +-
 arch/arm64/kernel/vdso/vdso.S                 |   6 +-
 arch/arm64/mm/mmap.c                          |   2 +-
 arch/blackfin/Kconfig                         |   1 +
 arch/c6x/include/uapi/asm/unistd.h            |   1 +
 arch/cris/Kconfig                             |   1 +
 arch/frv/Kconfig                              |   1 +
 arch/h8300/Kconfig                            |   1 +
 arch/h8300/include/uapi/asm/unistd.h          |   1 +
 arch/hexagon/Kconfig                          |   1 +
 arch/hexagon/include/uapi/asm/unistd.h        |   1 +
 arch/m32r/Kconfig                             |   1 +
 arch/m68k/Kconfig                             |   1 +
 arch/metag/Kconfig                            |   1 +
 arch/metag/include/uapi/asm/unistd.h          |   1 +
 arch/microblaze/Kconfig                       |   1 +
 arch/mips/Kconfig                             |   1 +
 arch/mn10300/Kconfig                          |   1 +
 arch/nios2/Kconfig                            |   1 +
 arch/nios2/include/uapi/asm/unistd.h          |   1 +
 arch/openrisc/Kconfig                         |   1 +
 arch/openrisc/include/uapi/asm/unistd.h       |   1 +
 arch/parisc/Kconfig                           |   1 +
 arch/powerpc/Kconfig                          |   1 +
 arch/score/Kconfig                            |   1 +
 arch/score/include/uapi/asm/unistd.h          |   1 +
 arch/sh/Kconfig                               |   1 +
 arch/sparc/Kconfig                            |   1 +
 arch/tile/Kconfig                             |   1 +
 arch/tile/include/uapi/asm/unistd.h           |   1 +
 arch/tile/kernel/compat.c                     |   3 +
 arch/unicore32/Kconfig                        |   1 +
 arch/unicore32/include/uapi/asm/unistd.h      |   1 +
 arch/x86/Kconfig                              |   1 +
 arch/x86/um/Kconfig                           |   1 +
 arch/xtensa/Kconfig                           |   1 +
 drivers/clocksource/arm_arch_timer.c          |   4 +-
 include/linux/fcntl.h                         |   2 +-
 include/linux/sched.h                         |   1 +
 include/linux/thread_bits.h                   |  76 ++++
 include/linux/thread_info.h                   |  64 +---
 include/uapi/asm-generic/unistd.h             |  10 +-
 kernel/ptrace.c                               |  48 ++-
 scripts/checksyscalls.sh                      |   5 +
 100 files changed, 1675 insertions(+), 698 deletions(-)
 create mode 100644 Documentation/arm64/ilp32.txt
 create mode 100644 arch/arm64/include/asm/is_compat.h
 create mode 100644 arch/arm64/include/asm/signal32_common.h
 create mode 100644 arch/arm64/include/asm/signal_common.h
 create mode 100644 arch/arm64/include/asm/signal_ilp32.h
 create mode 100644 arch/arm64/kernel/binfmt_elf32.c
 create mode 100644 arch/arm64/kernel/binfmt_ilp32.c
 create mode 100644 arch/arm64/kernel/entry32_common.S
 create mode 100644 arch/arm64/kernel/entry_ilp32.S
 create mode 100644 arch/arm64/kernel/signal32_common.c
 create mode 100644 arch/arm64/kernel/signal_ilp32.c
 create mode 100644 arch/arm64/kernel/sys_ilp32.c
 create mode 100644 arch/arm64/kernel/vdso-ilp32/.gitignore
 create mode 100644 arch/arm64/kernel/vdso-ilp32/Makefile
 create mode 100644 arch/arm64/kernel/vdso-ilp32/vdso-ilp32.S
 create mode 100644 arch/arm64/kernel/vdso-ilp32/vdso-ilp32.lds.S
 create mode 100644 include/linux/thread_bits.h

-- 
2.17.0

^ permalink raw reply	[flat|nested] 104+ messages in thread

end of thread, other threads:[~2019-07-09 22:42 UTC | newest]

Thread overview: 104+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-05-15 19:11 [PATCH v9 00/24] ILP32 for ARM64 Yury Norov
2018-05-15 19:11 ` Yury Norov
2018-05-15 19:11 ` Yury Norov
2018-05-15 19:11 ` Yury Norov
2018-05-15 19:11 ` [PATCH 01/24] arm64: signal: Make parse_user_sigframe() independent of rt_sigframe layout Yury Norov
2018-05-15 19:11   ` Yury Norov
2018-05-15 19:11   ` Yury Norov
2018-05-15 19:11   ` Yury Norov
2018-05-15 19:11 ` [PATCH 02/24] ptrace: Add compat PTRACE_{G,S}ETSIGMASK handlers Yury Norov
2018-05-15 19:11   ` Yury Norov
2018-05-15 19:11   ` Yury Norov
2018-05-15 19:11   ` Yury Norov
2018-05-15 19:40 ` [PATCH v9 00/24] ILP32 for ARM64 Yury Norov
2018-05-15 19:40   ` Yury Norov
2018-05-15 19:40   ` Yury Norov
2018-05-15 19:40   ` Yury Norov
2018-05-16  8:18 Yury Norov
2018-05-16  8:18 ` Yury Norov
2018-05-16  8:18 ` Yury Norov
2018-05-16  8:18 ` Yury Norov
2018-07-24 17:39 ` Yury Norov
2018-07-24 17:39   ` Yury Norov
2018-07-24 17:39   ` Yury Norov
2018-07-24 17:39   ` Yury Norov
2018-07-25  9:48   ` Andreas Schwab
2018-07-25  9:48     ` Andreas Schwab
2018-07-25  9:48     ` Andreas Schwab
2018-07-25  9:48     ` Andreas Schwab
2018-10-10 14:10   ` Eugene Syromiatnikov
2018-10-10 14:10     ` Eugene Syromiatnikov
2018-10-10 14:10     ` Eugene Syromiatnikov
2018-10-10 14:18     ` Arnd Bergmann
2018-10-10 14:18       ` Arnd Bergmann
2018-10-10 14:18       ` Arnd Bergmann
2018-10-10 14:39     ` Szabolcs Nagy
2018-10-10 14:39       ` Szabolcs Nagy
2018-10-10 14:39       ` Szabolcs Nagy
2018-10-13  2:07       ` Eugene Syromiatnikov
2018-10-13  2:07         ` Eugene Syromiatnikov
2018-10-13  2:07         ` Eugene Syromiatnikov
2018-10-13  9:20         ` Catalin Marinas
2018-10-13  9:20           ` Catalin Marinas
2018-10-13  9:20           ` Catalin Marinas
2018-10-14 19:53         ` Arnd Bergmann
2018-10-14 19:53           ` Arnd Bergmann
2018-10-14 19:53           ` Arnd Bergmann
2018-10-10 15:36     ` Catalin Marinas
2018-10-10 15:36       ` Catalin Marinas
2018-10-10 15:36       ` Catalin Marinas
2018-10-13  2:14       ` Eugene Syromiatnikov
2018-10-13  2:14         ` Eugene Syromiatnikov
2018-10-13  2:14         ` Eugene Syromiatnikov
2018-10-13  9:34         ` Catalin Marinas
2018-10-13  9:34           ` Catalin Marinas
2018-10-13  9:34           ` Catalin Marinas
2018-10-13 13:43           ` Yury Norov
2018-10-13 13:43             ` Yury Norov
2018-10-13 13:43             ` Yury Norov
2018-10-13 13:43             ` Yury Norov
2018-10-13 16:54           ` Andy Lutomirski
2018-10-13 16:54             ` Andy Lutomirski
2018-10-13 16:54             ` Andy Lutomirski
2018-11-13 10:04   ` Andreas Schwab
2018-11-13 10:57     ` Yury Norov
2018-11-15  0:51       ` Catalin Marinas
2018-11-15  8:54         ` Andreas Schwab
2018-11-15 20:27           ` Yury Norov
2018-11-19  9:57             ` Andreas Schwab
2018-10-13 19:36 ` Andy Lutomirski
2018-10-13 19:36   ` Andy Lutomirski
2018-10-13 19:36   ` Andy Lutomirski
2018-10-14 19:49   ` Arnd Bergmann
2018-10-14 19:49     ` Arnd Bergmann
2018-10-14 19:49     ` Arnd Bergmann
2018-10-18 11:14     ` Catalin Marinas
2018-10-18 11:14       ` Catalin Marinas
2018-10-18 11:14       ` Catalin Marinas
2018-11-19 21:29 ` Yury Norov
2018-11-19 21:29   ` Yury Norov
2018-11-19 21:29   ` Yury Norov
2018-11-19 21:29   ` Yury Norov
2019-01-07 15:50 ` Yuri Norov
2019-01-07 15:50   ` Yuri Norov
2019-01-07 15:50   ` Yuri Norov
2019-01-07 15:50   ` Yuri Norov
     [not found]   ` <DC9A951E-B638-4820-8499-02D5322E7DF7@amacapital.net>
2019-01-07 20:43     ` Yuri Norov
2019-01-07 20:43       ` Yuri Norov
2019-01-07 20:43       ` Yuri Norov
2019-01-07 20:43       ` Yuri Norov
2019-03-05 20:56 ` Yury Norov
2019-03-05 20:56   ` Yury Norov
2019-03-05 20:56   ` Yury Norov
2019-05-08 22:59 ` Yury Norov
2019-05-08 22:59   ` Yury Norov
2019-05-08 22:59   ` Yury Norov
2019-05-08 23:10   ` Yury Norov
2019-05-08 23:10     ` Yury Norov
2019-05-08 23:10     ` Yury Norov
2019-05-13  8:48   ` Andreas Schwab
2019-05-13  8:48     ` Andreas Schwab
2019-05-13  8:48     ` Andreas Schwab
2019-07-09 22:42 ` Yury Norov
2019-07-09 22:42   ` Yury Norov
2019-07-09 22:42   ` Yury Norov

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.