Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1271664 > unrolled thread
| Started by | Yury Norov <ynorov@caviumnetworks.com> |
|---|---|
| First post | 2015-11-17 22:20 +0100 |
| Last post | 2015-11-23 17:50 +0100 |
| Articles | 20 on this page of 30 — 7 participants |
Back to article view | Back to linux.kernel
[RFC2 PATCH v6 00/19] ILP32 for ARM64 Yury Norov <ynorov@caviumnetworks.com> - 2015-11-17 22:20 +0100
[PATCH v6 10/19] arm64:ilp32 use the native LP64 'start_thread' for ILP32 threads Yury Norov <ynorov@caviumnetworks.com> - 2015-11-17 22:30 +0100
[PATCH v6 12/19] ptrace: Allow compat to use the native siginfo Yury Norov <ynorov@caviumnetworks.com> - 2015-11-17 22:30 +0100
[PATCH v6 19/19] arm64:ilp32: add ARM64_ILP32 to Kconfig Yury Norov <ynorov@caviumnetworks.com> - 2015-11-17 22:30 +0100
[PATCH v6 13/19] arm64: ilp32: common 32-bit wrappers Yury Norov <ynorov@caviumnetworks.com> - 2015-11-17 22:30 +0100
[PATCH v6 15/19] arm64: ilp32: force IPC_64 in msgctl, shmctl, semctl Yury Norov <ynorov@caviumnetworks.com> - 2015-11-17 22:30 +0100
Re: [PATCH v6 15/19] arm64: ilp32: force IPC_64 in msgctl, shmctl, semctl Arnd Bergmann <arnd@arndb.de> - 2015-11-17 23:10 +0100
Re: [PATCH v6 15/19] arm64: ilp32: force IPC_64 in msgctl, shmctl, semctl Andreas Schwab <schwab@suse.de> - 2015-11-18 09:30 +0100
Re: [PATCH v6 15/19] arm64: ilp32: force IPC_64 in msgctl, shmctl, semctl Arnd Bergmann <arnd@arndb.de> - 2015-11-18 10:30 +0100
Re: [PATCH v6 15/19] arm64: ilp32: force IPC_64 in msgctl, shmctl, semctl Geert Uytterhoeven <geert@linux-m68k.org> - 2015-11-18 11:10 +0100
Re: [PATCH v6 15/19] arm64: ilp32: force IPC_64 in msgctl, shmctl, semctl Arnd Bergmann <arnd@arndb.de> - 2015-11-18 13:10 +0100
[PATCH v6 17/19] arm64:ilp32: use the native siginfo instead of the compat siginfo Yury Norov <ynorov@caviumnetworks.com> - 2015-11-17 22:30 +0100
[PATCH v6 09/19] arm64:ilp32: share HWCAP between LP64 and ILP32 Yury Norov <ynorov@caviumnetworks.com> - 2015-11-17 22:30 +0100
[PATCH v6 14/19] arm64:ilp32: add sys_ilp32.c and a separate table (in entry.S) to use it Yury Norov <ynorov@caviumnetworks.com> - 2015-11-17 22:30 +0100
Re: [PATCH v6 14/19] arm64:ilp32: add sys_ilp32.c and a separate table (in entry.S) to use it Arnd Bergmann <arnd@arndb.de> - 2015-11-17 23:10 +0100
Re: [PATCH v6 14/19] arm64:ilp32: add sys_ilp32.c and a separate table (in entry.S) to use it Arnd Bergmann <arnd@arndb.de> - 2015-11-18 09:20 +0100
Re: [PATCH v6 14/19] arm64:ilp32: add sys_ilp32.c and a separate table (in entry.S) to use it Andreas Schwab <schwab@suse.de> - 2015-11-19 14:30 +0100
Re: [PATCH v6 14/19] arm64:ilp32: add sys_ilp32.c and a separate table (in entry.S) to use it Arnd Bergmann <arnd@arndb.de> - 2015-11-19 14:40 +0100
[PATCH v6 16/19] aarch64: ilp32: use generic stat64 structure Yury Norov <ynorov@caviumnetworks.com> - 2015-11-17 22:30 +0100
Re: [PATCH v6 16/19] aarch64: ilp32: use generic stat64 structure Arnd Bergmann <arnd@arndb.de> - 2015-11-17 23:20 +0100
Re: [PATCH v6 16/19] aarch64: ilp32: use generic stat64 structure Arnd Bergmann <arnd@arndb.de> - 2015-11-18 22:00 +0100
[PATCH v6 11/19] arm64:ilp32: support core dump generation for ILP32 Yury Norov <ynorov@caviumnetworks.com> - 2015-11-17 22:30 +0100
Re: [PATCH v6 06/19] arm64:ilp32: share signal structures between ILP32 and LP64 ABIs Arnd Bergmann <arnd@arndb.de> - 2015-11-17 23:20 +0100
Re: [RFC2 PATCH v6 00/19] ILP32 for ARM64 "Zhangjian (Bamvor)" <bamvor.zhangjian@huawei.com> - 2015-11-18 09:10 +0100
Re: [PATCH v6 18/19] arm64:ilp32: change COMPAT_ELF_PLATFORM to report a a subplatform for ILP32 "Zhangjian (Bamvor)" <bamvor.zhangjian@huawei.com> - 2015-11-18 09:20 +0100
Re: [PATCH v6 18/19] arm64:ilp32: change COMPAT_ELF_PLATFORM to report a a subplatform for ILP32 pinskia@gmail.com - 2015-11-18 12:30 +0100
Re: [PATCH v6 18/19] arm64:ilp32: change COMPAT_ELF_PLATFORM to report a a subplatform for ILP32 Yury Norov <ynorov@caviumnetworks.com> - 2015-11-18 21:30 +0100
Re: [PATCH v6 18/19] arm64:ilp32: change COMPAT_ELF_PLATFORM to report a a subplatform for ILP32 "Dr. Philipp Tomsich" <philipp.tomsich@theobroma-systems.com> - 2015-11-18 23:10 +0100
Re: [PATCH v6 01/19] arm64:ilp32: add documentation on the ILP32 ABI for ARM64 "Zhangjian (Bamvor)" <bamvor.zhangjian@huawei.com> - 2015-11-18 09:20 +0100
Re: [RFC2 PATCH v6 00/19] ILP32 for ARM64 Andreas Schwab <schwab@suse.de> - 2015-11-23 17:50 +0100
Page 1 of 2 [1] 2 Next page →
| From | Yury Norov <ynorov@caviumnetworks.com> |
|---|---|
| Date | 2015-11-17 22:20 +0100 |
| Subject | [RFC2 PATCH v6 00/19] ILP32 for ARM64 |
| Message-ID | <qvVPr-1Xk-3@gated-at.bofh.it> |
------8<-----
Colleagues, I'm gonna to send it to list.
Please, take a look.
------8<-----
This is still RFC because ~20 tests still fail,
and because it's based on 4.3 kernel version, and
some work is needed to rebase on 4.4. I'd preffer
to do it later.
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:
- time_t, __kenel_off_t and other types turned to be 32-bit
for compatibility reasons (after v5 discussion);
- related changes applied to ILP32 syscall table and handlers;
- ILP32 VDSO code excluded. It's not mandatory, and caused questions
during review process. We definitely make sure we will follow up
with a VDSO later on because it is needed for performance reasons;
- fixed build issues with different combinations of AARCH32 / ILP32
enabling in config;
- ILP32 TLS bug fixed;
- entry32-common.S introduced to hold wrappers needed for both ILP32
and AARCH32_EL0;
- documentation updated according to latest changes;
- rebased to the current head;
- coding style re-checked;
- ILP32 syscall table turned around.
Testing is performed using LTP with scenario 'ltplite'.
Tested on QEMU + vanilla defconfig kernel.
Regressions are mostly related to core dump genereation,
readdir(), and futex(). Some tests fail both in ILP32, and LP64.
The full regression table is:
ILP32 LP64
float_bessel FAIL 134 PASSED 0
float_exp_log FAIL 134 PASSED 0
float_iperb FAIL 134 PASSED 0
float_power FAIL 134 PASSED 0
float_trigo FAIL 134 PASSED 0
abort01 FAIL 2 FAIL 2
fcntl14 FAIL 2 FAIL 2
kill11 FAIL 2 FAIL 2
mmap16 FAIL 6 PASSED 0
open12 FAIL 2 PASSED 0
pause01 PASSED 0 FAIL 9
pipe07 FAIL 2 PASSED 0
readdir01 FAIL 1 PASSED 0
rename11 FAIL 2 PASSED 0
rmdir02 FAIL 2 PASSED 0
setregid02 FAIL 1 FAIL 1
settimeofday01 FAIL 1 FAIL 1
umount2_01 FAIL 2 PASSED 0
umount2_02 FAIL 2 PASSED 0
umount2_03 FAIL 2 PASSED 0
utime06 FAIL 2 PASSED 0
Kernel with this patchset, and corresponding
version of glibc is here:
https://github.com/norov/
Andrew Pinski (14):
arm64: ensure the kernel is compiled for LP64
arm64: rename COMPAT to AARCH32_EL0 in Kconfig
arm64: change some CONFIG_COMPAT over to use CONFIG_AARCH32_EL0
instead
arm64:uapi: set __BITS_PER_LONG correctly for ILP32 and LP64
arm64:ilp32: share signal structures between ILP32 and LP64 ABIs
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:ilp32: share HWCAP between LP64 and ILP32
arm64:ilp32 use the native LP64 'start_thread' for ILP32 threads
arm64:ilp32: support core dump generation for ILP32
ptrace: Allow compat to use the native siginfo
arm64:ilp32: add sys_ilp32.c and a separate table (in entry.S) to use
it
arm64:ilp32: use the native siginfo instead of the compat siginfo
arm64:ilp32: add ARM64_ILP32 to Kconfig
Jan Dakinevich (2):
ilp32: common 32-bit wrappers
arm64: ilp32: force IPC_64 in msgctl, shmctl, semctl
Philipp Tomsich (2):
arm64:ilp32: add documentation on the ILP32 ABI for ARM64
arm64:ilp32: change COMPAT_ELF_PLATFORM to report a a subplatform for
ILP32
Yury Norov (1):
aarch64: ilp32: use generic stat64 structure
Documentation/arm64/ilp32.txt | 47 +++++++
arch/arm64/Kconfig | 12 ++
arch/arm64/Makefile | 5 +
arch/arm64/include/asm/compat.h | 70 +++++++++-
arch/arm64/include/asm/elf.h | 105 ++++++++++++--
arch/arm64/include/asm/fpsimd.h | 2 +-
arch/arm64/include/asm/hwcap.h | 12 +-
arch/arm64/include/asm/memory.h | 2 +-
arch/arm64/include/asm/processor.h | 18 ++-
arch/arm64/include/asm/ptrace.h | 2 +-
arch/arm64/include/asm/signal32.h | 19 +++
arch/arm64/include/asm/stat.h | 2 +
arch/arm64/include/asm/thread_info.h | 3 +-
arch/arm64/include/asm/unistd.h | 11 +-
arch/arm64/include/uapi/asm/bitsperlong.h | 9 +-
arch/arm64/include/uapi/asm/siginfo.h | 21 +++
arch/arm64/include/uapi/asm/signal.h | 31 +++++
arch/arm64/kernel/Makefile | 4 +-
arch/arm64/kernel/asm-offsets.c | 2 +-
arch/arm64/kernel/entry.S | 18 ++-
arch/arm64/kernel/entry32-common.S | 37 +++++
arch/arm64/kernel/entry32.S | 29 ----
arch/arm64/kernel/head.S | 2 +-
arch/arm64/kernel/hw_breakpoint.c | 7 +-
arch/arm64/kernel/perf_regs.c | 2 +-
arch/arm64/kernel/process.c | 4 +-
arch/arm64/kernel/ptrace.c | 47 ++++---
arch/arm64/kernel/signal.c | 21 ++-
arch/arm64/kernel/sys_ilp32.c | 223 ++++++++++++++++++++++++++++++
arch/arm64/kernel/traps.c | 4 +-
arch/arm64/kernel/vdso.c | 12 +-
include/linux/compat.h | 4 +
include/uapi/asm-generic/siginfo.h | 17 ++-
include/uapi/asm-generic/signal.h | 27 +++-
kernel/ptrace.c | 24 +++-
35 files changed, 745 insertions(+), 110 deletions(-)
create mode 100644 Documentation/arm64/ilp32.txt
create mode 100644 arch/arm64/kernel/entry32-common.S
create mode 100644 arch/arm64/kernel/sys_ilp32.c
--
2.1.4
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
[toc] | [next] | [standalone]
| From | Yury Norov <ynorov@caviumnetworks.com> |
|---|---|
| Date | 2015-11-17 22:30 +0100 |
| Subject | [PATCH v6 10/19] arm64:ilp32 use the native LP64 'start_thread' for ILP32 threads |
| Message-ID | <qvVZ7-20O-1@gated-at.bofh.it> |
| In reply to | #1271664 |
From: Andrew Pinski <apinski@cavium.com>
If we have both ILP32 and AARCH32 compiled in, we need use the non compat start
thread for ILP32.
Reviewed-by: David Daney <ddaney@caviumnetworks.com>
Signed-off-by: Philipp Tomsich <philipp.tomsich@theobroma-systems.com>
Signed-off-by: Christoph Muellner <christoph.muellner@theobroma-systems.com>
Signed-off-by: Yury Norov <ynorov@caviumnetworks.com>
Signed-off-by: Andrew Pinski <Andrew.Pinski@caviumnetworks.com>
---
arch/arm64/include/asm/processor.h | 10 ++++++++++
1 file changed, 10 insertions(+)
diff --git a/arch/arm64/include/asm/processor.h b/arch/arm64/include/asm/processor.h
index a415dd0..e244cb4 100644
--- a/arch/arm64/include/asm/processor.h
+++ b/arch/arm64/include/asm/processor.h
@@ -28,6 +28,7 @@
#ifdef __KERNEL__
#include <linux/string.h>
+#include <linux/thread_info.h>
#include <asm/fpsimd.h>
#include <asm/hw_breakpoint.h>
@@ -123,6 +124,15 @@ static inline void start_thread(struct pt_regs *regs, unsigned long pc,
static inline void compat_start_thread(struct pt_regs *regs, unsigned long pc,
unsigned long sp)
{
+#ifdef CONFIG_ARM64_ILP32
+ /* ILP32 thread are started the same way as LP64 threads.
+ Note we cannot use is_ilp32_compat_task here as that
+ would introduce a header depency issue. */
+ if (test_thread_flag(TIF_32BIT_AARCH64)) {
+ start_thread(regs, pc, sp);
+ return;
+ }
+#endif
start_thread_common(regs, pc);
regs->pstate = COMPAT_PSR_MODE_USR;
if (pc & 1)
--
2.1.4
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
[toc] | [prev] | [next] | [standalone]
| From | Yury Norov <ynorov@caviumnetworks.com> |
|---|---|
| Date | 2015-11-17 22:30 +0100 |
| Subject | [PATCH v6 12/19] ptrace: Allow compat to use the native siginfo |
| Message-ID | <qvVZ8-20O-25@gated-at.bofh.it> |
| In reply to | #1271664 |
From: Andrew Pinski <apinski@cavium.com>
Set COMPAT_USE_NATIVE_SIGINFO to be true for non AARCH32 tasks.
With ARM64 ILP32 ABI, we want to use the non-compat
siginfo as we want to simplify signal handling for this new ABI.
This patch just adds a new define COMPAT_USE_NATIVE_SIGINFO and
if it is true then read/write in the compat case as it was the
non-compat case.
Reviewed-by: David Daney <ddaney@caviumnetworks.com>
Signed-off-by: Christoph Muellner <christoph.muellner@theobroma-systems.com>
Signed-off-by: Philipp Tomsich <philipp.tomsich@theobroma-systems.com>
Signed-off-by: Yury Norov <ynorov@caviumnetworks.com>
Signed-off-by: Andrew Pinski <Andrew.Pinski@caviumnetworks.com>
---
include/linux/compat.h | 4 ++++
kernel/ptrace.c | 24 +++++++++++++++++-------
2 files changed, 21 insertions(+), 7 deletions(-)
diff --git a/include/linux/compat.h b/include/linux/compat.h
index a76c917..0a25d90 100644
--- a/include/linux/compat.h
+++ b/include/linux/compat.h
@@ -24,6 +24,10 @@
#define COMPAT_USE_64BIT_TIME 0
#endif
+#ifndef COMPAT_USE_NATIVE_SIGINFO
+#define COMPAT_USE_NATIVE_SIGINFO 0
+#endif
+
#ifndef __SC_DELOUSE
#define __SC_DELOUSE(t,v) ((t)(unsigned long)(v))
#endif
diff --git a/kernel/ptrace.c b/kernel/ptrace.c
index 787320d..04799aa 100644
--- a/kernel/ptrace.c
+++ b/kernel/ptrace.c
@@ -652,7 +652,7 @@ static int ptrace_peek_siginfo(struct task_struct *child,
break;
#ifdef CONFIG_COMPAT
- if (unlikely(is_compat_task())) {
+ if (unlikely(is_compat_task() && !COMPAT_USE_NATIVE_SIGINFO)) {
compat_siginfo_t __user *uinfo = compat_ptr(data);
if (copy_siginfo_to_user32(uinfo, &info) ||
@@ -1140,16 +1140,26 @@ int compat_ptrace_request(struct task_struct *child, compat_long_t request,
case PTRACE_GETSIGINFO:
ret = ptrace_getsiginfo(child, &siginfo);
- if (!ret)
- ret = copy_siginfo_to_user32(
- (struct compat_siginfo __user *) datap,
- &siginfo);
+ if (!ret) {
+ if (COMPAT_USE_NATIVE_SIGINFO)
+ ret = copy_siginfo_to_user(
+ (struct siginfo __user *) datap,
+ &siginfo);
+ else
+ ret = copy_siginfo_to_user32(
+ (struct compat_siginfo __user *) datap,
+ &siginfo);
+ }
break;
case PTRACE_SETSIGINFO:
memset(&siginfo, 0, sizeof siginfo);
- if (copy_siginfo_from_user32(
- &siginfo, (struct compat_siginfo __user *) datap))
+ if (COMPAT_USE_NATIVE_SIGINFO)
+ ret = copy_from_user(&siginfo, datap, sizeof(siginfo));
+ else
+ ret = copy_siginfo_from_user32(
+ &siginfo, (struct compat_siginfo __user *) datap);
+ if (ret)
ret = -EFAULT;
else
ret = ptrace_setsiginfo(child, &siginfo);
--
2.1.4
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
[toc] | [prev] | [next] | [standalone]
| From | Yury Norov <ynorov@caviumnetworks.com> |
|---|---|
| Date | 2015-11-17 22:30 +0100 |
| Subject | [PATCH v6 19/19] arm64:ilp32: add ARM64_ILP32 to Kconfig |
| Message-ID | <qvVZ8-20O-31@gated-at.bofh.it> |
| In reply to | #1271664 |
From: Andrew Pinski <apinski@cavium.com> This patch adds the config option for ILP32. Reviewed-by: David Daney <ddaney@caviumnetworks.com> Signed-off-by: Philipp Tomsich <philipp.tomsich@theobroma-systems.com> Signed-off-by: Christoph Muellner <christoph.muellner@theobroma-systems.com> Signed-off-by: Yury Norov <ynorov@caviumnetworks.com> Signed-off-by: Andrew Pinski <Andrew.Pinski@caviumnetworks.com> --- arch/arm64/Kconfig | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/arch/arm64/Kconfig b/arch/arm64/Kconfig index 4753d435..deec37a 100644 --- a/arch/arm64/Kconfig +++ b/arch/arm64/Kconfig @@ -680,7 +680,7 @@ source "fs/Kconfig.binfmt" config COMPAT def_bool y - depends on AARCH32_EL0 + depends on AARCH32_EL0 || ARM64_ILP32 select COMPAT_BINFMT_ELF config AARCH32_EL0 @@ -702,6 +702,13 @@ config AARCH32_EL0 If you want to execute 32-bit userspace applications, say Y. +config ARM64_ILP32 + bool "Kernel support for ILP32" + help + This option enables support for AArch64 ILP32 user space. ILP32 + is an ABI where long and pointers are 32bits but it uses the AARCH64 + instruction set. + config SYSVIPC_COMPAT def_bool y depends on COMPAT && SYSVIPC -- 2.1.4 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[toc] | [prev] | [next] | [standalone]
| From | Yury Norov <ynorov@caviumnetworks.com> |
|---|---|
| Date | 2015-11-17 22:30 +0100 |
| Subject | [PATCH v6 13/19] arm64: ilp32: common 32-bit wrappers |
| Message-ID | <qvVZ9-20O-45@gated-at.bofh.it> |
| In reply to | #1271664 |
From: Jan Dakinevich <jan.dakinevich@gmail.com> Reviewed-by: David Daney <ddaney@caviumnetworks.com> Signed-off-by: Yury Norov <ynorov@caviumnetworks.com> Signed-off-by: Jan Dakinevich <jan.dakinevich@gmail.com> --- arch/arm64/kernel/Makefile | 1 + arch/arm64/kernel/entry32-common.S | 37 +++++++++++++++++++++++++++++++++++++ arch/arm64/kernel/entry32.S | 29 ----------------------------- 3 files changed, 38 insertions(+), 29 deletions(-) create mode 100644 arch/arm64/kernel/entry32-common.S diff --git a/arch/arm64/kernel/Makefile b/arch/arm64/kernel/Makefile index 1470332..35a59af 100644 --- a/arch/arm64/kernel/Makefile +++ b/arch/arm64/kernel/Makefile @@ -24,6 +24,7 @@ arm64-obj-$(CONFIG_AARCH32_EL0) += sys32.o kuser32.o signal32.o \ sys_compat.o entry32.o \ ../../arm/kernel/opcodes.o arm64-obj-$(CONFIG_FUNCTION_TRACER) += ftrace.o entry-ftrace.o +arm64-obj-$(CONFIG_COMPAT) += entry32-common.o arm64-obj-$(CONFIG_MODULES) += arm64ksyms.o module.o arm64-obj-$(CONFIG_PERF_EVENTS) += perf_regs.o perf_callchain.o arm64-obj-$(CONFIG_HW_PERF_EVENTS) += perf_event.o diff --git a/arch/arm64/kernel/entry32-common.S b/arch/arm64/kernel/entry32-common.S new file mode 100644 index 0000000..2ad5912 --- /dev/null +++ b/arch/arm64/kernel/entry32-common.S @@ -0,0 +1,37 @@ +#include <linux/linkage.h> +#include <linux/const.h> + +#include <asm/assembler.h> +#include <asm/asm-offsets.h> +#include <asm/errno.h> +#include <asm/page.h> + +ENTRY(compat_sys_statfs64_wrapper) + mov w3, #84 + cmp w1, #88 + csel w1, w3, w1, eq + b compat_sys_statfs64 +ENDPROC(compat_sys_statfs64_wrapper) + +ENTRY(compat_sys_fstatfs64_wrapper) + mov w3, #84 + cmp w1, #88 + csel w1, w3, w1, eq + b compat_sys_fstatfs64 +ENDPROC(compat_sys_fstatfs64_wrapper) + +/* + * Note: off_4k (w5) is always in units of 4K. If we can't do the + * requested offset because it is not page-aligned, we return -EINVAL. + */ +ENTRY(compat_sys_mmap2_wrapper) +#if PAGE_SHIFT > 12 + tst w5, #~PAGE_MASK >> 12 + b.ne 1f + lsr w5, w5, #PAGE_SHIFT - 12 +#endif + b sys_mmap_pgoff +1: mov x0, #-EINVAL + ret +ENDPROC(compat_sys_mmap2_wrapper) + diff --git a/arch/arm64/kernel/entry32.S b/arch/arm64/kernel/entry32.S index f332d5d..8026129 100644 --- a/arch/arm64/kernel/entry32.S +++ b/arch/arm64/kernel/entry32.S @@ -40,35 +40,6 @@ ENTRY(compat_sys_rt_sigreturn_wrapper) b compat_sys_rt_sigreturn ENDPROC(compat_sys_rt_sigreturn_wrapper) -ENTRY(compat_sys_statfs64_wrapper) - mov w3, #84 - cmp w1, #88 - csel w1, w3, w1, eq - b compat_sys_statfs64 -ENDPROC(compat_sys_statfs64_wrapper) - -ENTRY(compat_sys_fstatfs64_wrapper) - mov w3, #84 - cmp w1, #88 - csel w1, w3, w1, eq - b compat_sys_fstatfs64 -ENDPROC(compat_sys_fstatfs64_wrapper) - -/* - * Note: off_4k (w5) is always in units of 4K. If we can't do the - * requested offset because it is not page-aligned, we return -EINVAL. - */ -ENTRY(compat_sys_mmap2_wrapper) -#if PAGE_SHIFT > 12 - tst w5, #~PAGE_MASK >> 12 - b.ne 1f - lsr w5, w5, #PAGE_SHIFT - 12 -#endif - b sys_mmap_pgoff -1: mov x0, #-EINVAL - ret -ENDPROC(compat_sys_mmap2_wrapper) - /* * Wrappers for AArch32 syscalls that either take 64-bit parameters * in registers or that take 32-bit parameters which require sign -- 2.1.4 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[toc] | [prev] | [next] | [standalone]
| From | Yury Norov <ynorov@caviumnetworks.com> |
|---|---|
| Date | 2015-11-17 22:30 +0100 |
| Subject | [PATCH v6 15/19] arm64: ilp32: force IPC_64 in msgctl, shmctl, semctl |
| Message-ID | <qvVZ9-20O-49@gated-at.bofh.it> |
| In reply to | #1271664 |
From: Jan Dakinevich <jan.dakinevich@gmail.com>
Reviewed-by: David Daney <ddaney@caviumnetworks.com>
Signed-off-by: Yury Norov <ynorov@caviumnetworks.com>
Signed-off-by: Jan Dakinevich <jan.dakinevich@gmail.com>
---
arch/arm64/kernel/sys_ilp32.c | 19 +++++++++++++++++++
1 file changed, 19 insertions(+)
diff --git a/arch/arm64/kernel/sys_ilp32.c b/arch/arm64/kernel/sys_ilp32.c
index c366d92..a2596f4 100644
--- a/arch/arm64/kernel/sys_ilp32.c
+++ b/arch/arm64/kernel/sys_ilp32.c
@@ -98,6 +98,25 @@ asmlinkage long compat_sys_statfs64_wrapper(void);
#define compat_sys_pwritev compat_sys_pwritev64
+/* IPC_64 */
+asmlinkage long ilp32_sys_msgctl(int first, int second, void __user *uptr)
+{
+ return compat_sys_msgctl(first, second | IPC_64, uptr);
+}
+#define compat_sys_msgctl ilp32_sys_msgctl
+
+asmlinkage long ilp32_sys_shmctl(int first, int second, void __user *uptr)
+{
+ return compat_sys_shmctl(first, second | IPC_64, uptr);
+}
+#define compat_sys_shmctl ilp32_sys_shmctl
+
+asmlinkage long ilp32_sys_semctl(int first, int second, int third, int arg)
+{
+ return compat_sys_semctl(first, second, third | IPC_64, arg);
+}
+#define compat_sys_semctl ilp32_sys_semctl
+
#include <asm/syscall.h>
#undef __SYSCALL
--
2.1.4
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
[toc] | [prev] | [next] | [standalone]
| From | Arnd Bergmann <arnd@arndb.de> |
|---|---|
| Date | 2015-11-17 23:10 +0100 |
| Subject | Re: [PATCH v6 15/19] arm64: ilp32: force IPC_64 in msgctl, shmctl, semctl |
| Message-ID | <qvWBR-2uT-23@gated-at.bofh.it> |
| In reply to | #1271673 |
On Wednesday 18 November 2015 00:16:55 Yury Norov wrote:
>
> +/* IPC_64 */
> +asmlinkage long ilp32_sys_msgctl(int first, int second, void __user *uptr)
> +{
> + return compat_sys_msgctl(first, second | IPC_64, uptr);
> +}
> +#define compat_sys_msgctl ilp32_sys_msgctl
> +
> +asmlinkage long ilp32_sys_shmctl(int first, int second, void __user *uptr)
> +{
> + return compat_sys_shmctl(first, second | IPC_64, uptr);
> +}
> +#define compat_sys_shmctl ilp32_sys_shmctl
> +
> +asmlinkage long ilp32_sys_semctl(int first, int second, int third, int arg)
> +{
> + return compat_sys_semctl(first, second, third | IPC_64, arg);
> +}
> +#define compat_sys_semctl ilp32_sys_semctl
>
I wonder if this would be any simpler by changing compat_ipc_parse_version()
Arnd
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
[toc] | [prev] | [next] | [standalone]
| From | Andreas Schwab <schwab@suse.de> |
|---|---|
| Date | 2015-11-18 09:30 +0100 |
| Subject | Re: [PATCH v6 15/19] arm64: ilp32: force IPC_64 in msgctl, shmctl, semctl |
| Message-ID | <qw6hQ-nn-17@gated-at.bofh.it> |
| In reply to | #1271695 |
Arnd Bergmann <arnd@arndb.de> writes:
> On Wednesday 18 November 2015 00:16:55 Yury Norov wrote:
>>
>> +/* IPC_64 */
>> +asmlinkage long ilp32_sys_msgctl(int first, int second, void __user *uptr)
>> +{
>> + return compat_sys_msgctl(first, second | IPC_64, uptr);
>> +}
>> +#define compat_sys_msgctl ilp32_sys_msgctl
>> +
>> +asmlinkage long ilp32_sys_shmctl(int first, int second, void __user *uptr)
>> +{
>> + return compat_sys_shmctl(first, second | IPC_64, uptr);
>> +}
>> +#define compat_sys_shmctl ilp32_sys_shmctl
>> +
>> +asmlinkage long ilp32_sys_semctl(int first, int second, int third, int arg)
>> +{
>> + return compat_sys_semctl(first, second, third | IPC_64, arg);
>> +}
>> +#define compat_sys_semctl ilp32_sys_semctl
>>
>
> I wonder if this would be any simpler by changing compat_ipc_parse_version()
This cries for a generic solution. Other archs migrating to separate
ipc syscalls will want to avoid the whole IPC_64 business for them, even
if they need to retain [compat_]ipc_parse_version for sys_ipc
compatibility.
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-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
[toc] | [prev] | [next] | [standalone]
| From | Arnd Bergmann <arnd@arndb.de> |
|---|---|
| Date | 2015-11-18 10:30 +0100 |
| Subject | Re: [PATCH v6 15/19] arm64: ilp32: force IPC_64 in msgctl, shmctl, semctl |
| Message-ID | <qw7dU-10j-29@gated-at.bofh.it> |
| In reply to | #1271924 |
On Wednesday 18 November 2015 09:25:40 Andreas Schwab wrote:
> Arnd Bergmann <arnd@arndb.de> writes:
>
> > On Wednesday 18 November 2015 00:16:55 Yury Norov wrote:
> >>
> >> +/* IPC_64 */
> >> +asmlinkage long ilp32_sys_msgctl(int first, int second, void __user *uptr)
> >> +{
> >> + return compat_sys_msgctl(first, second | IPC_64, uptr);
> >> +}
> >> +#define compat_sys_msgctl ilp32_sys_msgctl
> >> +
> >> +asmlinkage long ilp32_sys_shmctl(int first, int second, void __user *uptr)
> >> +{
> >> + return compat_sys_shmctl(first, second | IPC_64, uptr);
> >> +}
> >> +#define compat_sys_shmctl ilp32_sys_shmctl
> >> +
> >> +asmlinkage long ilp32_sys_semctl(int first, int second, int third, int arg)
> >> +{
> >> + return compat_sys_semctl(first, second, third | IPC_64, arg);
> >> +}
> >> +#define compat_sys_semctl ilp32_sys_semctl
> >>
> >
> > I wonder if this would be any simpler by changing compat_ipc_parse_version()
>
> This cries for a generic solution. Other archs migrating to separate
> ipc syscalls will want to avoid the whole IPC_64 business for them, even
> if they need to retain [compat_]ipc_parse_version for sys_ipc
> compatibility.
Agreed. I think all architectures are moving that way now, so we should
really try to get all cases right now.
I've done a complete list of what the architectures (see
https://docs.google.com/spreadsheets/d/18GxXEHE2ywnSr-SPoGFd1ABz6wEM1ex-JMu5lEraaH8/ )
We have these categories:
1. uses IPC_PARSE_VERSION with sys_ipc, and has just introduced
separate syscalls:
arm, avr32, powerpc, x86-32
2. uses IPC_PARSE_VERSION with sys_ipc, and has not yet introduced
separate syscalls (currently producing a compile warning):
cris, frv, m32r, m68k, mips (o32), mn10300, s390, sh32, sparc
3. uses IPC_PARSE_VERSION with separate syscalls:
alpha, blackfin, microblaze, mips (n32/64), xtensa
4a. only new-style IPC with separate syscalls:
ia64, parisc, sh64
4b. only new-style IPC with separate syscalls, using generic syscall
table:
arc, arm64, c6x, h8300, hexagon, metag, nios2, openrisc, score,
tile, unicore32
So we should probably fix 1. and 2. before it's too late, but make
sure we don't break 3. in the process.
Arnd
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
[toc] | [prev] | [next] | [standalone]
| From | Geert Uytterhoeven <geert@linux-m68k.org> |
|---|---|
| Date | 2015-11-18 11:10 +0100 |
| Subject | Re: [PATCH v6 15/19] arm64: ilp32: force IPC_64 in msgctl, shmctl, semctl |
| Message-ID | <qw7QC-1tN-17@gated-at.bofh.it> |
| In reply to | #1272037 |
On Wed, Nov 18, 2015 at 10:23 AM, Arnd Bergmann <arnd@arndb.de> wrote:
> On Wednesday 18 November 2015 09:25:40 Andreas Schwab wrote:
>> Arnd Bergmann <arnd@arndb.de> writes:
>>
>> > On Wednesday 18 November 2015 00:16:55 Yury Norov wrote:
>> >>
>> >> +/* IPC_64 */
>> >> +asmlinkage long ilp32_sys_msgctl(int first, int second, void __user *uptr)
>> >> +{
>> >> + return compat_sys_msgctl(first, second | IPC_64, uptr);
>> >> +}
>> >> +#define compat_sys_msgctl ilp32_sys_msgctl
>> >> +
>> >> +asmlinkage long ilp32_sys_shmctl(int first, int second, void __user *uptr)
>> >> +{
>> >> + return compat_sys_shmctl(first, second | IPC_64, uptr);
>> >> +}
>> >> +#define compat_sys_shmctl ilp32_sys_shmctl
>> >> +
>> >> +asmlinkage long ilp32_sys_semctl(int first, int second, int third, int arg)
>> >> +{
>> >> + return compat_sys_semctl(first, second, third | IPC_64, arg);
>> >> +}
>> >> +#define compat_sys_semctl ilp32_sys_semctl
>> >>
>> >
>> > I wonder if this would be any simpler by changing compat_ipc_parse_version()
>>
>> This cries for a generic solution. Other archs migrating to separate
>> ipc syscalls will want to avoid the whole IPC_64 business for them, even
>> if they need to retain [compat_]ipc_parse_version for sys_ipc
>> compatibility.
>
> Agreed. I think all architectures are moving that way now, so we should
> really try to get all cases right now.
>
> I've done a complete list of what the architectures (see
> https://docs.google.com/spreadsheets/d/18GxXEHE2ywnSr-SPoGFd1ABz6wEM1ex-JMu5lEraaH8/ )
>
> We have these categories:
>
> 1. uses IPC_PARSE_VERSION with sys_ipc, and has just introduced
> separate syscalls:
>
> arm, avr32, powerpc, x86-32
x86-32, where?
> 2. uses IPC_PARSE_VERSION with sys_ipc, and has not yet introduced
> separate syscalls (currently producing a compile warning):
>
> cris, frv, m32r, m68k, mips (o32), mn10300, s390, sh32, sparc
>
> 3. uses IPC_PARSE_VERSION with separate syscalls:
>
> alpha, blackfin, microblaze, mips (n32/64), xtensa
>
> 4a. only new-style IPC with separate syscalls:
>
> ia64, parisc, sh64
and x86-64?
> 4b. only new-style IPC with separate syscalls, using generic syscall
> table:
>
> arc, arm64, c6x, h8300, hexagon, metag, nios2, openrisc, score,
> tile, unicore32
>
> So we should probably fix 1. and 2. before it's too late, but make
> sure we don't break 3. in the process.
(Fortunately?) x86-32 doesn't seem to be converted in next yet?
I was hoping for them to do the heavy lifting for the generic solution ;-)
Gr{oetje,eeting}s,
Geert
--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org
In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
-- Linus Torvalds
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
[toc] | [prev] | [next] | [standalone]
| From | Arnd Bergmann <arnd@arndb.de> |
|---|---|
| Date | 2015-11-18 13:10 +0100 |
| Subject | Re: [PATCH v6 15/19] arm64: ilp32: force IPC_64 in msgctl, shmctl, semctl |
| Message-ID | <qw9IJ-2FA-1@gated-at.bofh.it> |
| In reply to | #1272072 |
On Wednesday 18 November 2015 11:07:26 Geert Uytterhoeven wrote: > > > > I've done a complete list of what the architectures (see > > https://docs.google.com/spreadsheets/d/18GxXEHE2ywnSr-SPoGFd1ABz6wEM1ex-JMu5lEraaH8/ ) > > > > We have these categories: > > > > 1. uses IPC_PARSE_VERSION with sys_ipc, and has just introduced > > separate syscalls: > > > > arm, avr32, powerpc, x86-32 > > x86-32, where? My mistake. x86 uses a different way to do this, so I didn't see it using grep and just assumed that Andy Lutomirski had patched it already based on my memory of https://sourceware.org/ml/libc-alpha/2015-09/msg00323.html > > 2. uses IPC_PARSE_VERSION with sys_ipc, and has not yet introduced > > separate syscalls (currently producing a compile warning): > > > > cris, frv, m32r, m68k, mips (o32), mn10300, s390, sh32, sparc > > > > 3. uses IPC_PARSE_VERSION with separate syscalls: > > > > alpha, blackfin, microblaze, mips (n32/64), xtensa > > > > 4a. only new-style IPC with separate syscalls: > > > > ia64, parisc, sh64 > > and x86-64? right, that too. I got it in my spreadsheet by copied it wrong. > > 4b. only new-style IPC with separate syscalls, using generic syscall > > table: > > > > arc, arm64, c6x, h8300, hexagon, metag, nios2, openrisc, score, > > tile, unicore32 > > > > So we should probably fix 1. and 2. before it's too late, but make > > sure we don't break 3. in the process. > > (Fortunately?) x86-32 doesn't seem to be converted in next yet? > > I was hoping for them to do the heavy lifting for the generic solution yes, that would be nice ;-) Arnd -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[toc] | [prev] | [next] | [standalone]
| From | Yury Norov <ynorov@caviumnetworks.com> |
|---|---|
| Date | 2015-11-17 22:30 +0100 |
| Subject | [PATCH v6 17/19] arm64:ilp32: use the native siginfo instead of the compat siginfo |
| Message-ID | <qvVZ9-20O-53@gated-at.bofh.it> |
| In reply to | #1271664 |
From: Andrew Pinski <apinski@cavium.com>
Set COMPAT_USE_NATIVE_SIGINFO to be true for non AARCH32 tasks.
Reviewed-by: David Daney <ddaney@caviumnetworks.com>
Signed-off-by: Philipp Tomsich <philipp.tomsich@theobroma-systems.com>
Signed-off-by: Christoph Muellner <christoph.muellner@theobroma-systems.com>
Signed-off-by: Yury Norov <ynorov@caviumnetworks.com>
Signed-off-by: Andrew Pinski <Andrew.Pinski@caviumnetworks.com>
---
arch/arm64/include/asm/compat.h | 3 +++
1 file changed, 3 insertions(+)
diff --git a/arch/arm64/include/asm/compat.h b/arch/arm64/include/asm/compat.h
index 95d2d72..087f21b 100644
--- a/arch/arm64/include/asm/compat.h
+++ b/arch/arm64/include/asm/compat.h
@@ -214,6 +214,9 @@ typedef struct compat_siginfo {
} _sifields;
} compat_siginfo_t;
+/* ILP32 uses the native siginfo and not the compat struct */
+#define COMPAT_USE_NATIVE_SIGINFO !is_a32_compat_task()
+
#define COMPAT_OFF_T_MAX 0x7fffffff
#define COMPAT_LOFF_T_MAX 0x7fffffffffffffffL
--
2.1.4
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
[toc] | [prev] | [next] | [standalone]
| From | Yury Norov <ynorov@caviumnetworks.com> |
|---|---|
| Date | 2015-11-17 22:30 +0100 |
| Subject | [PATCH v6 09/19] arm64:ilp32: share HWCAP between LP64 and ILP32 |
| Message-ID | <qvVZ9-20O-51@gated-at.bofh.it> |
| In reply to | #1271664 |
From: Andrew Pinski <apinski@cavium.com> Reviewed-by: David Daney <ddaney@caviumnetworks.com> Signed-off-by: Philipp Tomsich <philipp.tomsich@theobroma-systems.com> Signed-off-by: Christoph Muellner <christoph.muellner@theobroma-systems.com> Signed-off-by: Yury Norov <ynorov@caviumnetworks.com> Signed-off-by: Andrew Pinski <Andrew.Pinski@caviumnetworks.com> --- arch/arm64/include/asm/hwcap.h | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/arch/arm64/include/asm/hwcap.h b/arch/arm64/include/asm/hwcap.h index 0ad7351..1e5361e 100644 --- a/arch/arm64/include/asm/hwcap.h +++ b/arch/arm64/include/asm/hwcap.h @@ -47,9 +47,17 @@ #define ELF_HWCAP (elf_hwcap) #ifdef CONFIG_COMPAT -#define COMPAT_ELF_HWCAP (compat_elf_hwcap) -#define COMPAT_ELF_HWCAP2 (compat_elf_hwcap2) extern unsigned int compat_elf_hwcap, compat_elf_hwcap2; +#define COMPAT_ELF_HWCAP \ + (is_a32_compat_task() \ + ? compat_elf_hwcap \ + : elf_hwcap) + +#define COMPAT_ELF_HWCAP2 \ + (is_a32_compat_task() \ + ? compat_elf_hwcap2 \ + : 0) + #endif extern unsigned long elf_hwcap; -- 2.1.4 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[toc] | [prev] | [next] | [standalone]
| From | Yury Norov <ynorov@caviumnetworks.com> |
|---|---|
| Date | 2015-11-17 22:30 +0100 |
| Subject | [PATCH v6 14/19] arm64:ilp32: add sys_ilp32.c and a separate table (in entry.S) to use it |
| Message-ID | <qvVZ9-20O-61@gated-at.bofh.it> |
| In reply to | #1271664 |
From: Andrew Pinski <apinski@cavium.com>
Add a separate syscall-table for ILP32, which dispatches either to native
LP64 system call implementation or to compat-syscalls, as appropriate.
Reviewed-by: David Daney <ddaney@caviumnetworks.com>
Signed-off-by: Philipp Tomsich <philipp.tomsich@theobroma-systems.com>
Signed-off-by: Christoph Muellner <christoph.muellner@theobroma-systems.com>
Signed-off-by: Yury Norov <ynorov@caviumnetworks.com>
Signed-off-by: Andrew Pinski <Andrew.Pinski@caviumnetworks.com>
---
arch/arm64/include/asm/unistd.h | 7 ++-
arch/arm64/kernel/Makefile | 1 +
arch/arm64/kernel/entry.S | 12 +++-
arch/arm64/kernel/sys_ilp32.c | 118 ++++++++++++++++++++++++++++++++++++++++
4 files changed, 136 insertions(+), 2 deletions(-)
create mode 100644 arch/arm64/kernel/sys_ilp32.c
diff --git a/arch/arm64/include/asm/unistd.h b/arch/arm64/include/asm/unistd.h
index 4c2cbbc..696e638 100644
--- a/arch/arm64/include/asm/unistd.h
+++ b/arch/arm64/include/asm/unistd.h
@@ -13,13 +13,16 @@
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
+#ifdef CONFIG_ARM64_ILP32
+#define __ARCH_WANT_COMPAT_SYS_PREADV64
+#define __ARCH_WANT_COMPAT_SYS_PWRITEV64
+#endif
#ifdef CONFIG_AARCH32_EL0
#define __ARCH_WANT_COMPAT_SYS_GETDENTS64
#define __ARCH_WANT_COMPAT_STAT64
#define __ARCH_WANT_SYS_GETHOSTNAME
#define __ARCH_WANT_SYS_PAUSE
#define __ARCH_WANT_SYS_GETPGRP
-#define __ARCH_WANT_SYS_LLSEEK
#define __ARCH_WANT_SYS_NICE
#define __ARCH_WANT_SYS_SIGPENDING
#define __ARCH_WANT_SYS_SIGPROCMASK
@@ -39,6 +42,8 @@
#define __NR_compat_sigreturn 119
#define __NR_compat_rt_sigreturn 173
+#define __ARCH_WANT_SYS_LLSEEK
+
/*
* The following SVCs are ARM private.
*/
diff --git a/arch/arm64/kernel/Makefile b/arch/arm64/kernel/Makefile
index 35a59af..837d730 100644
--- a/arch/arm64/kernel/Makefile
+++ b/arch/arm64/kernel/Makefile
@@ -24,6 +24,7 @@ arm64-obj-$(CONFIG_AARCH32_EL0) += sys32.o kuser32.o signal32.o \
sys_compat.o entry32.o \
../../arm/kernel/opcodes.o
arm64-obj-$(CONFIG_FUNCTION_TRACER) += ftrace.o entry-ftrace.o
+arm64-obj-$(CONFIG_ARM64_ILP32) += sys_ilp32.o
arm64-obj-$(CONFIG_COMPAT) += entry32-common.o
arm64-obj-$(CONFIG_MODULES) += arm64ksyms.o module.o
arm64-obj-$(CONFIG_PERF_EVENTS) += perf_regs.o perf_callchain.o
diff --git a/arch/arm64/kernel/entry.S b/arch/arm64/kernel/entry.S
index 52be5c8..bcd921a 100644
--- a/arch/arm64/kernel/entry.S
+++ b/arch/arm64/kernel/entry.S
@@ -664,9 +664,13 @@ ENDPROC(ret_from_fork)
*/
.align 6
el0_svc:
- adrp stbl, sys_call_table // load syscall table pointer
uxtw scno, w8 // syscall number in w8
mov sc_nr, #__NR_syscalls
+#ifdef CONFIG_ARM64_ILP32
+ ldr x16, [tsk, #TI_FLAGS]
+ tbnz x16, #TIF_32BIT_AARCH64, el0_ilp32_svc // We are using ILP32
+#endif
+ adrp stbl, sys_call_table // load syscall table pointer
el0_svc_naked: // compat entry point
stp x0, scno, [sp, #S_ORIG_X0] // save the original x0 and syscall number
enable_dbg_and_irq
@@ -686,6 +690,12 @@ ni_sys:
b ret_fast_syscall
ENDPROC(el0_svc)
+#ifdef CONFIG_ARM64_ILP32
+el0_ilp32_svc:
+ adrp stbl, sys_call_ilp32_table // load syscall table pointer
+ b el0_svc_naked
+#endif
+
/*
* This is the really slow path. We're going to be doing context
* switches, and waiting for our parent to respond.
diff --git a/arch/arm64/kernel/sys_ilp32.c b/arch/arm64/kernel/sys_ilp32.c
new file mode 100644
index 0000000..c366d92
--- /dev/null
+++ b/arch/arm64/kernel/sys_ilp32.c
@@ -0,0 +1,118 @@
+/*
+ * AArch64- ILP32 specific system calls implementation
+ *
+ * Copyright (C) 2015 Cavium Inc.
+ * Author: Andrew Pinski <apinski@cavium.com>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
+#include <linux/compiler.h>
+#include <linux/errno.h>
+#include <linux/fs.h>
+#include <linux/mm.h>
+#include <linux/msg.h>
+#include <linux/export.h>
+#include <linux/sched.h>
+#include <linux/slab.h>
+#include <linux/syscalls.h>
+#include <linux/compat.h>
+
+/*
+ * Wrappers to pass the pt_regs argument.
+ */
+asmlinkage long sys_rt_sigreturn_wrapper(void);
+#define compat_sys_rt_sigreturn sys_rt_sigreturn_wrapper
+
+/* Using non-compat syscalls where necessary */
+#define compat_sys_fadvise64_64 sys_fadvise64_64
+#define compat_sys_fallocate sys_fallocate
+#define compat_sys_ftruncate64 sys_ftruncate
+#define compat_sys_pread64 sys_pread64
+#define compat_sys_pwrite64 sys_pwrite64
+#define compat_sys_readahead sys_readahead
+#define compat_sys_rt_sigaction sys_rt_sigaction
+#define compat_sys_shmat sys_shmat
+#define compat_sys_sync_file_range sys_sync_file_range
+#define compat_sys_truncate64 sys_truncate
+#define compat_sys_sigaltstack sys_sigaltstack
+
+#define compat_sys_io_getevents sys_io_getevents
+#define compat_sys_lookup_dcookie sys_lookup_dcookie
+#define compat_sys_epoll_pwait sys_epoll_pwait
+#define compat_sys_fcntl64 compat_sys_fcntl
+#define compat_sys_preadv compat_sys_preadv64
+#define compat_sys_signalfd4 sys_signalfd4
+
+#define compat_sys_rt_sigsuspend sys_rt_sigsuspend
+#define compat_sys_rt_sigprocmask sys_rt_sigprocmask
+#define compat_sys_rt_sigpending sys_rt_sigpending
+#define compat_sys_rt_sigqueueinfo sys_rt_sigqueueinfo
+#define compat_sys_semtimedop sys_semtimedop
+#define compat_sys_rt_tgsigqueueinfo sys_rt_tgsigqueueinfo
+
+#define compat_sys_timer_create sys_timer_create
+#define compat_sys_timer_gettime sys_timer_gettime
+#define compat_sys_timer_settime sys_timer_settime
+#define compat_sys_rt_sigtimedwait sys_rt_sigtimedwait
+
+#define compat_sys_mq_open sys_mq_open
+#define compat_sys_mq_timedsend sys_mq_timedsend
+#define compat_sys_mq_timedreceive sys_mq_timedreceive
+#define compat_sys_mq_getsetattr sys_mq_getsetattr
+#define compat_sys_mq_open sys_mq_open
+
+#define compat_sys_open_by_handle_at sys_open_by_handle_at
+#define compat_sys_clock_adjtime sys_clock_adjtime
+
+#define compat_sys_openat sys_openat
+#define compat_sys_getdents64 sys_getdents64
+#define compat_sys_waitid sys_waitid
+#define compat_sys_timer_settime sys_timer_settime
+#define compat_sys_sched_rr_get_interval sys_sched_rr_get_interval
+#define compat_sys_execveat sys_execveat
+
+#define compat_sys_mq_notify sys_mq_notify
+#define compat_sys_clock_nanosleep sys_clock_nanosleep
+#define compat_sys_clock_getres sys_clock_getres
+
+#define sys_lseek sys_llseek
+
+asmlinkage long compat_sys_mmap2_wrapper(void);
+#define sys_mmap2 compat_sys_mmap2_wrapper
+
+asmlinkage long compat_sys_fstatfs64_wrapper(void);
+#define compat_sys_fstatfs64 compat_sys_fstatfs64_wrapper
+asmlinkage long compat_sys_statfs64_wrapper(void);
+#define compat_sys_statfs64 compat_sys_statfs64_wrapper
+
+#define compat_sys_pwritev compat_sys_pwritev64
+
+#include <asm/syscall.h>
+
+#undef __SYSCALL
+#undef __SC_COMP
+#undef __SC_3264
+#undef __SC_COMP_3264
+
+#define __SYSCALL_COMPAT
+#define __SYSCALL(nr, sym) [nr] = sym,
+
+/*
+ * The sys_call_ilp32_table array must be 4K aligned to be accessible from
+ * kernel/entry.S.
+ */
+void *sys_call_ilp32_table[__NR_syscalls] __aligned(4096) = {
+ [0 ... __NR_syscalls - 1] = sys_ni_syscall,
+#include <asm/unistd.h>
+};
--
2.1.4
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
[toc] | [prev] | [next] | [standalone]
| From | Arnd Bergmann <arnd@arndb.de> |
|---|---|
| Date | 2015-11-17 23:10 +0100 |
| Subject | Re: [PATCH v6 14/19] arm64:ilp32: add sys_ilp32.c and a separate table (in entry.S) to use it |
| Message-ID | <qvWBQ-2uT-5@gated-at.bofh.it> |
| In reply to | #1271677 |
On Wednesday 18 November 2015 00:16:54 Yury Norov wrote: > From: Andrew Pinski <apinski@cavium.com> > > Add a separate syscall-table for ILP32, which dispatches either to native > LP64 system call implementation or to compat-syscalls, as appropriate. I like it much better than the previous version, thanks for the rework! However, it seems that you accidentally have a lot more redirects than you should have: > +/* Using non-compat syscalls where necessary */ > +#define compat_sys_fadvise64_64 sys_fadvise64_64 > +#define compat_sys_fallocate sys_fallocate > +#define compat_sys_ftruncate64 sys_ftruncate > +#define compat_sys_pread64 sys_pread64 > +#define compat_sys_pwrite64 sys_pwrite64 > +#define compat_sys_readahead sys_readahead Makes sense. These of course all require the respective changes in glibc as discussed in the thread regarding loff_t handling. > +#define compat_sys_rt_sigaction sys_rt_sigaction > +#define compat_sys_shmat sys_shmat What's special about compat_sys_shmat? > +#define compat_sys_sync_file_range sys_sync_file_range > +#define compat_sys_truncate64 sys_truncate > +#define compat_sys_sigaltstack sys_sigaltstack > + > +#define compat_sys_io_getevents sys_io_getevents io_getevents seems wrong, you are passing the wrong timespec and aio_context_t here. > +#define compat_sys_lookup_dcookie sys_lookup_dcookie > +#define compat_sys_epoll_pwait sys_epoll_pwait epoll_pwait takes sigset_t, which I'd assume is different between ilp32 and lp64, so this is probably wrong too, at least on big-endian. > +#define compat_sys_fcntl64 compat_sys_fcntl This uses compat_off_t, not compat_loff_t, and needs to be changed. > +#define compat_sys_signalfd4 sys_signalfd4 > +#define compat_sys_rt_sigsuspend sys_rt_sigsuspend > +#define compat_sys_rt_sigprocmask sys_rt_sigprocmask > +#define compat_sys_rt_sigpending sys_rt_sigpending sigset_t again, all four of these. > +#define compat_sys_rt_sigqueueinfo sys_rt_sigqueueinfo this looks ok though, as you have the 64-bit siginfo > +#define compat_sys_semtimedop sys_semtimedop timespec again > +#define compat_sys_rt_tgsigqueueinfo sys_rt_tgsigqueueinfo > + > +#define compat_sys_timer_create sys_timer_create > +#define compat_sys_timer_gettime sys_timer_gettime > +#define compat_sys_timer_settime sys_timer_settime timespec again for gettime/settime. create seems fine if you require the use of the 64-bit sigevent (why?) > +#define compat_sys_rt_sigtimedwait sys_rt_sigtimedwait This one probably needs a custom wrapper as you have the 64-bit siginfo, but the 32-bit sigset and timespec. > +#define compat_sys_mq_open sys_mq_open > +#define compat_sys_mq_timedsend sys_mq_timedsend > +#define compat_sys_mq_timedreceive sys_mq_timedreceive > +#define compat_sys_mq_getsetattr sys_mq_getsetattr > +#define compat_sys_mq_open sys_mq_open You have compat_sys_mq_open twice, and they all look wrong because you get the wrong struct mq_attr. > +#define compat_sys_open_by_handle_at sys_open_by_handle_at The only difference here is the forced O_LARGEFILE, but that is set by glibc anyway, right? > +#define compat_sys_clock_adjtime sys_clock_adjtime wrong timex structure > +#define compat_sys_openat sys_openat same as open_by_handle_at > +#define compat_sys_getdents64 sys_getdents64 glibc uses linux_dirent64 for 32-bit architectures, so this looks wrong > +#define compat_sys_waitid sys_waitid This will probably need a separate wrapper to convert rusage but not siginfo > +#define compat_sys_timer_settime sys_timer_settime > +#define compat_sys_sched_rr_get_interval sys_sched_rr_get_interval timespec again > +#define compat_sys_execveat sys_execveat This probably gives you the wrong struct user_arg_ptr > +#define compat_sys_mq_notify sys_mq_notify ok. > +#define compat_sys_clock_nanosleep sys_clock_nanosleep > +#define compat_sys_clock_getres sys_clock_getres timespec > +#define sys_lseek sys_llseek This seems pointless, as there is no sys_lseek > +asmlinkage long compat_sys_mmap2_wrapper(void); > +#define sys_mmap2 compat_sys_mmap2_wrapper > + > +asmlinkage long compat_sys_fstatfs64_wrapper(void); > +#define compat_sys_fstatfs64 compat_sys_fstatfs64_wrapper > +asmlinkage long compat_sys_statfs64_wrapper(void); > +#define compat_sys_statfs64 compat_sys_statfs64_wrapper What are the wrappers for again? Maybe add a comment here. > +#define compat_sys_preadv compat_sys_preadv64 > +#define compat_sys_pwritev compat_sys_pwritev64 wrong iovec. Arnd -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[toc] | [prev] | [next] | [standalone]
| From | Arnd Bergmann <arnd@arndb.de> |
|---|---|
| Date | 2015-11-18 09:20 +0100 |
| Subject | Re: [PATCH v6 14/19] arm64:ilp32: add sys_ilp32.c and a separate table (in entry.S) to use it |
| Message-ID | <qw689-jO-1@gated-at.bofh.it> |
| In reply to | #1271692 |
On Tuesday 17 November 2015 22:57:52 Arnd Bergmann wrote: > > +#define compat_sys_open_by_handle_at sys_open_by_handle_at > > The only difference here is the forced O_LARGEFILE, but that > is set by glibc anyway, right? > > > +#define compat_sys_openat sys_openat > > same as open_by_handle_at > I gave it some more thought, and I think we should actually stay with sys_open_by_handle_at and sys_openat, but do it a little differently: Forcing O_LARGEFILE is probably what we want for all architectures going forward, so we should change asm-generic/unistd.h to use sys_openat for compat mode, and override it for tile32 compat, which is the only existing user of this table at the moment and which needs to retain the existing behavior. Arnd -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[toc] | [prev] | [next] | [standalone]
| From | Andreas Schwab <schwab@suse.de> |
|---|---|
| Date | 2015-11-19 14:30 +0100 |
| Subject | Re: [PATCH v6 14/19] arm64:ilp32: add sys_ilp32.c and a separate table (in entry.S) to use it |
| Message-ID | <qwxrI-1qr-13@gated-at.bofh.it> |
| In reply to | #1271692 |
Arnd Bergmann <arnd@arndb.de> writes: > On Wednesday 18 November 2015 00:16:54 Yury Norov wrote: >> +#define sys_lseek sys_llseek > > This seems pointless, as there is no sys_lseek I think it should be the other way round. Why would you want to use llseek if you can pass loff_t in a single register? 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-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[toc] | [prev] | [next] | [standalone]
| From | Arnd Bergmann <arnd@arndb.de> |
|---|---|
| Date | 2015-11-19 14:40 +0100 |
| Subject | Re: [PATCH v6 14/19] arm64:ilp32: add sys_ilp32.c and a separate table (in entry.S) to use it |
| Message-ID | <qwxBo-1tR-7@gated-at.bofh.it> |
| In reply to | #1273127 |
On Thursday 19 November 2015 14:21:16 Andreas Schwab wrote: > Arnd Bergmann <arnd@arndb.de> writes: > > > On Wednesday 18 November 2015 00:16:54 Yury Norov wrote: > >> +#define sys_lseek sys_llseek > > > > This seems pointless, as there is no sys_lseek > > I think it should be the other way round. Why would you want to use > llseek if you can pass loff_t in a single register? Right, it makes more sense the other way round. Arnd -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[toc] | [prev] | [next] | [standalone]
| From | Yury Norov <ynorov@caviumnetworks.com> |
|---|---|
| Date | 2015-11-17 22:30 +0100 |
| Subject | [PATCH v6 16/19] aarch64: ilp32: use generic stat64 structure |
| Message-ID | <qvVZ9-20O-57@gated-at.bofh.it> |
| In reply to | #1271664 |
Generic 32-bit and AARCH32 stat64 structures has same names.
ILP32 needs generic stat64. So we can either make ILP32 mutual
exclusive with AARCH32, or duplicate generic cp_new_stat64 code
and struct stat64 to sys_ilp32.c. We choose second because it's
more flexible to have independend support for ABIs.
Reviewed-by: David Daney <ddaney@caviumnetworks.com>
Signed-off-by: Yury Norov <ynorov@caviumnetworks.com>
---
arch/arm64/kernel/sys_ilp32.c | 86 +++++++++++++++++++++++++++++++++++++++++++
1 file changed, 86 insertions(+)
diff --git a/arch/arm64/kernel/sys_ilp32.c b/arch/arm64/kernel/sys_ilp32.c
index a2596f4..c5bc712 100644
--- a/arch/arm64/kernel/sys_ilp32.c
+++ b/arch/arm64/kernel/sys_ilp32.c
@@ -117,6 +117,92 @@ asmlinkage long ilp32_sys_semctl(int first, int second, int third, int arg)
}
#define compat_sys_semctl ilp32_sys_semctl
+struct ilp32_stat {
+ unsigned long st_dev;
+
+ unsigned long st_ino;
+
+ unsigned int st_mode;
+ unsigned int st_nlink;
+
+ unsigned int st_uid;
+ unsigned int st_gid;
+
+ unsigned long st_rdev;
+ unsigned long __st_rdev_pad;
+
+ long st_size;
+
+ unsigned int st_blksize;
+ unsigned int __st_blksize_pad;
+
+ unsigned long st_blocks;
+
+ unsigned int st_atime;
+ unsigned int st_atime_nsec;
+
+ unsigned int st_mtime;
+ unsigned int st_mtime_nsec;
+
+ unsigned int st_ctime;
+ unsigned int st_ctime_nsec;
+
+ unsigned int __unused[2];
+};
+
+static long ilp32_cp_stat(struct kstat *stat,
+ struct ilp32_stat __user *statbuf)
+{
+ struct ilp32_stat tmp = {
+ .st_dev = huge_encode_dev(stat->dev),
+ .st_ino = stat->ino,
+ .st_mode = stat->mode,
+ .st_nlink = stat->nlink,
+ .st_uid = from_kuid_munged(current_user_ns(), stat->uid),
+ .st_gid = from_kgid_munged(current_user_ns(), stat->gid),
+ .st_rdev = huge_encode_dev(stat->rdev),
+ .__st_rdev_pad = 0,
+ .st_size = stat->size,
+ .st_blksize = stat->blksize,
+ .__st_blksize_pad = 0,
+ .st_blocks = stat->blocks,
+ .st_atime = stat->atime.tv_sec,
+ .st_atime_nsec = stat->atime.tv_nsec,
+ .st_mtime = stat->mtime.tv_sec,
+ .st_mtime_nsec = stat->mtime.tv_nsec,
+ .st_ctime = stat->ctime.tv_sec,
+ .st_ctime_nsec = stat->ctime.tv_nsec,
+ .__unused = { 0, 0 }
+ };
+
+ return copy_to_user(statbuf, &tmp, sizeof(tmp)) ? -EFAULT : 0;
+}
+
+asmlinkage long ilp32_sys_fstat64(unsigned int fd,
+ struct ilp32_stat __user *statbuf)
+{
+ struct kstat stat;
+ int error = vfs_fstat(fd, &stat);
+
+ if (!error)
+ error = ilp32_cp_stat(&stat, statbuf);
+ return error;
+}
+#define sys_fstat64 ilp32_sys_fstat64
+
+asmlinkage long ilp32_sys_fstatat64(unsigned int dfd,
+ const char __user *filename,
+ struct ilp32_stat __user *statbuf, int flag)
+{
+ struct kstat stat;
+ int error = vfs_fstatat(dfd, filename, &stat, flag);
+
+ if (!error)
+ error = ilp32_cp_stat(&stat, statbuf);
+ return error;
+}
+#define sys_fstatat64 ilp32_sys_fstatat64
+
#include <asm/syscall.h>
#undef __SYSCALL
--
2.1.4
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
[toc] | [prev] | [next] | [standalone]
| From | Arnd Bergmann <arnd@arndb.de> |
|---|---|
| Date | 2015-11-17 23:20 +0100 |
| Subject | Re: [PATCH v6 16/19] aarch64: ilp32: use generic stat64 structure |
| Message-ID | <qvWLw-2zc-23@gated-at.bofh.it> |
| In reply to | #1271678 |
On Wednesday 18 November 2015 00:16:56 Yury Norov wrote: > Generic 32-bit and AARCH32 stat64 structures has same names. > ILP32 needs generic stat64. So we can either make ILP32 mutual > exclusive with AARCH32, or duplicate generic cp_new_stat64 code > and struct stat64 to sys_ilp32.c. We choose second because it's > more flexible to have independend support for ABIs. > I commented on the previous version, but you have not replied to that, or changed anything. Arnd -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[toc] | [prev] | [next] | [standalone]
Page 1 of 2 [1] 2 Next page →
Back to top | Article view | linux.kernel
csiph-web