Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1292558 > unrolled thread

[RFC3 PATCH v6 00/20] ILP32 for ARM64

Started byYury Norov <ynorov@caviumnetworks.com>
First post2015-12-15 22:50 +0100
Last post2015-12-16 17:30 +0100
Articles 20 on this page of 68 — 8 participants

Back to article view | Back to linux.kernel


Contents

  [RFC3 PATCH v6 00/20] ILP32 for ARM64 Yury Norov <ynorov@caviumnetworks.com> - 2015-12-15 22:50 +0100
    [PATCH v6 10/20] arm64:ilp32 use the native LP64 'start_thread' for ILP32 threads Yury Norov <ynorov@caviumnetworks.com> - 2015-12-15 22:50 +0100
      Re: [PATCH v6 10/20] arm64:ilp32 use the native LP64 'start_thread' for ILP32 threads Arnd Bergmann <arnd@arndb.de> - 2015-12-16 17:00 +0100
        Re: [PATCH v6 10/20] arm64:ilp32 use the native LP64 'start_thread'  for ILP32 threads Yury Norov <ynorov@caviumnetworks.com> - 2015-12-18 15:00 +0100
    [PATCH v6 12/20] arm64:ilp32: add sys_ilp32.c and a separate table (in entry.S) to use it Yury Norov <ynorov@caviumnetworks.com> - 2015-12-15 22:50 +0100
      Re: [PATCH v6 12/20] arm64:ilp32: add sys_ilp32.c and a separate table (in entry.S) to use it Arnd Bergmann <arnd@arndb.de> - 2015-12-16 17:10 +0100
      Re: [PATCH v6 12/20] arm64:ilp32: add sys_ilp32.c and a separate  table (in entry.S) to use it Catalin Marinas <catalin.marinas@arm.com> - 2015-12-17 19:30 +0100
        Re: [PATCH v6 12/20] arm64:ilp32: add sys_ilp32.c and a separate table (in entry.S) to use it Arnd Bergmann <arnd@arndb.de> - 2015-12-17 21:20 +0100
          Re: [PATCH v6 12/20] arm64:ilp32: add sys_ilp32.c and a separate  table (in entry.S) to use it Andrew Pinski <pinskia@gmail.com> - 2015-12-17 21:20 +0100
            Re: [PATCH v6 12/20] arm64:ilp32: add sys_ilp32.c and a separate table (in entry.S) to use it Arnd Bergmann <arnd@arndb.de> - 2015-12-17 22:00 +0100
            Re: [PATCH v6 12/20] arm64:ilp32: add sys_ilp32.c and a separate  table (in entry.S) to use it Catalin Marinas <catalin.marinas@arm.com> - 2015-12-18 12:50 +0100
              Re: [PATCH v6 12/20] arm64:ilp32: add sys_ilp32.c and a separate table (in entry.S) to use it Arnd Bergmann <arnd@arndb.de> - 2015-12-18 14:00 +0100
                Re: [PATCH v6 12/20] arm64:ilp32: add sys_ilp32.c and a separate  table (in entry.S) to use it Catalin Marinas <catalin.marinas@arm.com> - 2015-12-21 19:40 +0100
                  Re: [PATCH v6 12/20] arm64:ilp32: add sys_ilp32.c and a separate table (in entry.S) to use it Arnd Bergmann <arnd@arndb.de> - 2015-12-21 23:30 +0100
                Re: [PATCH v6 12/20] arm64:ilp32: add sys_ilp32.c and a separate table (in entry.S) to use it "Dr. Philipp Tomsich" <philipp.tomsich@theobroma-systems.com> - 2015-12-21 19:50 +0100
                  Re: [PATCH v6 12/20] arm64:ilp32: add sys_ilp32.c and a separate table (in entry.S) to use it Arnd Bergmann <arnd@arndb.de> - 2015-12-21 23:20 +0100
      Re: [PATCH v6 12/20] arm64:ilp32: add sys_ilp32.c and a separate table (in entry.S) to use it Arnd Bergmann <arnd@arndb.de> - 2015-12-21 23:40 +0100
        Re: [PATCH v6 12/20] arm64:ilp32: add sys_ilp32.c and a separate  table (in entry.S) to use it Yury Norov <ynorov@caviumnetworks.com> - 2015-12-23 19:40 +0100
          Re: [PATCH v6 12/20] arm64:ilp32: add sys_ilp32.c and a separate table (in entry.S) to use it Arnd Bergmann <arnd@arndb.de> - 2015-12-23 22:50 +0100
    [PATCH v6 02/20] arm64: ensure the kernel is compiled for LP64 Yury Norov <ynorov@caviumnetworks.com> - 2015-12-15 22:50 +0100
    [PATCH v6 13/20] arm64: ilp32: share aarch32 syscall wrappers to ilp32 Yury Norov <ynorov@caviumnetworks.com> - 2015-12-15 22:50 +0100
      Re: [PATCH v6 13/20] arm64: ilp32: share aarch32 syscall wrappers to ilp32 Andreas Schwab <schwab@suse.de> - 2015-12-17 15:40 +0100
        Re: [PATCH v6 13/20] arm64: ilp32: share aarch32 syscall wrappers to  ilp32 Yury Norov <ynorov@caviumnetworks.com> - 2015-12-18 15:00 +0100
      Re: [PATCH v6 13/20] arm64: ilp32: share aarch32 syscall wrappers to  ilp32 Catalin Marinas <catalin.marinas@arm.com> - 2015-12-22 13:30 +0100
        Re: [PATCH v6 13/20] arm64: ilp32: share aarch32 syscall wrappers to ilp32 Arnd Bergmann <arnd@arndb.de> - 2015-12-22 22:50 +0100
          Re: [PATCH v6 13/20] arm64: ilp32: share aarch32 syscall wrappers to  ilp32 Catalin Marinas <catalin.marinas@arm.com> - 2015-12-23 14:40 +0100
            Re: [PATCH v6 13/20] arm64: ilp32: share aarch32 syscall wrappers to ilp32 Arnd Bergmann <arnd@arndb.de> - 2015-12-23 21:50 +0100
              Re: [PATCH v6 13/20] arm64: ilp32: share aarch32 syscall wrappers to  ilp32 Yury Norov <ynorov@caviumnetworks.com> - 2015-12-30 18:30 +0100
                Re: [PATCH v6 13/20] arm64: ilp32: share aarch32 syscall wrappers to ilp32 Arnd Bergmann <arnd@arndb.de> - 2015-12-30 23:40 +0100
        Re: [PATCH v6 13/20] arm64: ilp32: share aarch32 syscall wrappers to  ilp32 Yury Norov <ynorov@caviumnetworks.com> - 2015-12-23 05:30 +0100
    [PATCH v6 08/20] arm64: ilp32: add is_ilp32_compat_{task,thread} and TIF_32BIT_AARCH64 Yury Norov <ynorov@caviumnetworks.com> - 2015-12-15 22:50 +0100
      Re: [PATCH v6 08/20] arm64: ilp32: add is_ilp32_compat_{task,  thread} and TIF_32BIT_AARCH64 Catalin Marinas <catalin.marinas@arm.com> - 2015-12-17 12:50 +0100
        Re: [PATCH v6 08/20] arm64: ilp32: add is_ilp32_compat_{task,  thread} and TIF_32BIT_AARCH64 Yury Norov <ynorov@caviumnetworks.com> - 2015-12-18 15:20 +0100
          Re: [PATCH v6 08/20] arm64: ilp32: add is_ilp32_compat_{task,  thread} and TIF_32BIT_AARCH64 Yury Norov <ynorov@caviumnetworks.com> - 2015-12-18 15:50 +0100
            Re: [PATCH v6 08/20] arm64: ilp32: add is_ilp32_compat_{task,  thread} and TIF_32BIT_AARCH64 Catalin Marinas <catalin.marinas@arm.com> - 2015-12-21 18:50 +0100
    [PATCH v6 04/20] arm64: change some CONFIG_COMPAT over to use CONFIG_AARCH32_EL0 instead Yury Norov <ynorov@caviumnetworks.com> - 2015-12-15 22:50 +0100
      Re: [PATCH v6 04/20] arm64: change some CONFIG_COMPAT over to use  CONFIG_AARCH32_EL0 instead Yury Norov <ynorov@caviumnetworks.com> - 2015-12-23 15:20 +0100
      > diff --git a/arch/arm64/kernel/Makefile b/arch/arm64/kernel/Makefile Bamvor Jian Zhang <bamvor.zhangjian@linaro.org> - 2015-12-28 09:50 +0100
        Re: [PATCH v6 04/20] arm64: change some CONFIG_COMPAT over to use  CONFIG_AARCH32_EL0 instead "Zhangjian (Bamvor)" <bamvor.zhangjian@huawei.com> - 2015-12-28 10:10 +0100
          Re: [PATCH v6 04/20] arm64: change some CONFIG_COMPAT over to use  CONFIG_AARCH32_EL0 instead Yury Norov <ynorov@caviumnetworks.com> - 2015-12-29 13:40 +0100
            [PATCH] arm64: compat: fix wrong dependency Bamvor Jian Zhang <bamvor.zhangjian@linaro.org> - 2015-12-29 16:10 +0100
          Re: [PATCH v6 04/20] arm64: change some CONFIG_COMPAT over to use  CONFIG_AARCH32_EL0 instead Yury Norov <ynorov@caviumnetworks.com> - 2015-12-29 14:20 +0100
    [PATCH v6 01/20] arm64: ilp32: add documentation on the ILP32 ABI for ARM64 Yury Norov <ynorov@caviumnetworks.com> - 2015-12-15 22:50 +0100
    [PATCH v6 09/20] arm64:ilp32: share HWCAP between LP64 and ILP32 Yury Norov <ynorov@caviumnetworks.com> - 2015-12-15 22:50 +0100
      Re: [PATCH v6 09/20] arm64:ilp32: share HWCAP between LP64 and ILP32 Arnd Bergmann <arnd@arndb.de> - 2015-12-16 17:00 +0100
        Re: [PATCH v6 09/20] arm64:ilp32: share HWCAP between LP64 and ILP32 Catalin Marinas <catalin.marinas@arm.com> - 2015-12-16 18:00 +0100
          Re: [PATCH v6 09/20] arm64:ilp32: share HWCAP between LP64 and ILP32 Catalin Marinas <catalin.marinas@arm.com> - 2015-12-16 18:20 +0100
            Re: [PATCH v6 09/20] arm64:ilp32: share HWCAP between LP64 and ILP32 Arnd Bergmann <arnd@arndb.de> - 2015-12-16 20:20 +0100
              Re: [PATCH v6 09/20] arm64:ilp32: share HWCAP between LP64 and ILP32 Catalin Marinas <catalin.marinas@arm.com> - 2015-12-17 12:00 +0100
                Re: [PATCH v6 09/20] arm64:ilp32: share HWCAP between LP64 and ILP32 Arnd Bergmann <arnd@arndb.de> - 2015-12-17 15:00 +0100
    [PATCH v6 07/20] arm64: introduce is_a32_task and is_a32_thread (for AArch32 compat) Yury Norov <ynorov@caviumnetworks.com> - 2015-12-15 22:50 +0100
      Re: [PATCH v6 07/20] arm64: introduce is_a32_task and is_a32_thread  (for AArch32 compat) Catalin Marinas <catalin.marinas@arm.com> - 2015-12-17 12:40 +0100
    [PATCH v6 05/20] arm64:uapi: set __BITS_PER_LONG correctly for ILP32 and LP64 Yury Norov <ynorov@caviumnetworks.com> - 2015-12-15 22:50 +0100
    [PATCH v6 11/20] arm64:ilp32: support core dump generation for ILP32 Yury Norov <ynorov@caviumnetworks.com> - 2015-12-15 22:50 +0100
      Re: [PATCH v6 11/20] arm64:ilp32: support core dump generation for  ILP32 Catalin Marinas <catalin.marinas@arm.com> - 2015-12-17 15:10 +0100
    [PATCH v6 15/20] arm64: signal: move ilp32 and lp64 common code to separated file Yury Norov <ynorov@caviumnetworks.com> - 2015-12-15 22:50 +0100
      Re: [PATCH v6 15/20] arm64: signal: move ilp32 and lp64 common code to separated file Arnd Bergmann <arnd@arndb.de> - 2015-12-16 17:10 +0100
        Re: [PATCH v6 15/20] arm64: signal: move ilp32 and lp64 common code  to separated file Yury Norov <ynorov@caviumnetworks.com> - 2015-12-18 14:50 +0100
          Re: [PATCH v6 15/20] arm64: signal: move ilp32 and lp64 common code to separated file Arnd Bergmann <arnd@arndb.de> - 2015-12-18 15:20 +0100
      Re: [PATCH v6 15/20] arm64: signal: move ilp32 and lp64 common code  to separated file Catalin Marinas <catalin.marinas@arm.com> - 2015-12-22 18:20 +0100
    [PATCH v6 17/20] arm64: ilp32: introduce ilp32-specific handlers for sigframe Yury Norov <ynorov@caviumnetworks.com> - 2015-12-15 23:00 +0100
      Re: [PATCH v6 17/20] arm64: ilp32: introduce ilp32-specific handlers  for sigframe Catalin Marinas <catalin.marinas@arm.com> - 2015-12-22 18:20 +0100
    [PATCH v6 18/20] arm64:ilp32: add vdso-ilp32 and use for signal return Yury Norov <ynorov@caviumnetworks.com> - 2015-12-15 23:00 +0100
    [PATCH v6 19/20] arm64:ilp32: change COMPAT_ELF_PLATFORM to report a a subplatform for ILP32 Yury Norov <ynorov@caviumnetworks.com> - 2015-12-15 23:00 +0100
    [PATCH v6 20/20] arm64:ilp32: add ARM64_ILP32 to Kconfig Yury Norov <ynorov@caviumnetworks.com> - 2015-12-15 23:00 +0100
    [PATCH v6 16/20] arm64: signal32: move ilp32 and aarch32 common code to separated file Yury Norov <ynorov@caviumnetworks.com> - 2015-12-15 23:00 +0100
      Re: [PATCH v6 16/20] arm64: signal32: move ilp32 and aarch32 common  code to separated file Catalin Marinas <catalin.marinas@arm.com> - 2015-12-22 15:30 +0100
    Re: [RFC3 PATCH v6 00/20] ILP32 for ARM64 Arnd Bergmann <arnd@arndb.de> - 2015-12-16 17:30 +0100

Page 2 of 4 — ← Prev page 1 [2] 3 4  Next page →


#1292564 — [PATCH v6 13/20] arm64: ilp32: share aarch32 syscall wrappers to ilp32

FromYury Norov <ynorov@caviumnetworks.com>
Date2015-12-15 22:50 +0100
Subject[PATCH v6 13/20] arm64: ilp32: share aarch32 syscall wrappers to ilp32
Message-ID<qG5DQ-1iE-25@gated-at.bofh.it>
In reply to#1292558
From: Jan Dakinevich <jan.dakinevich@gmail.com>

statfs64, fstat64 and mmap_pgoff has wrappers that needed both by aarch32 and
ilp32 to workaround some issues. Here we create common file to share aarch32
workarounds to with ilp32 code.

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 -----------------------------
 arch/arm64/kernel/sys_ilp32.c      |  9 +++++++++
 4 files changed, 47 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 8787347..837d730 100644
--- a/arch/arm64/kernel/Makefile
+++ b/arch/arm64/kernel/Makefile
@@ -25,6 +25,7 @@ arm64-obj-$(CONFIG_AARCH32_EL0)		+= sys32.o kuser32.o signal32.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
 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
diff --git a/arch/arm64/kernel/sys_ilp32.c b/arch/arm64/kernel/sys_ilp32.c
index 8ce79db..c282fa2 100644
--- a/arch/arm64/kernel/sys_ilp32.c
+++ b/arch/arm64/kernel/sys_ilp32.c
@@ -45,6 +45,15 @@
 #define compat_sys_open_by_handle_at   sys_open_by_handle_at
 #define compat_sys_openat              sys_openat
 
+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
+
 #include <asm/syscall.h>
 
 #undef __SYSCALL
-- 
2.5.0

--
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]


#1293942 — Re: [PATCH v6 13/20] arm64: ilp32: share aarch32 syscall wrappers to ilp32

FromAndreas Schwab <schwab@suse.de>
Date2015-12-17 15:40 +0100
SubjectRe: [PATCH v6 13/20] arm64: ilp32: share aarch32 syscall wrappers to ilp32
Message-ID<qGHSO-EG-19@gated-at.bofh.it>
In reply to#1292564
Yury Norov <ynorov@caviumnetworks.com> writes:

> From: Jan Dakinevich <jan.dakinevich@gmail.com>
>
> statfs64, fstat64 and mmap_pgoff has wrappers that needed both by aarch32 and

Typo: s/fstat64/fstatfs64/

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]


#1294829 — Re: [PATCH v6 13/20] arm64: ilp32: share aarch32 syscall wrappers to ilp32

FromYury Norov <ynorov@caviumnetworks.com>
Date2015-12-18 15:00 +0100
SubjectRe: [PATCH v6 13/20] arm64: ilp32: share aarch32 syscall wrappers to ilp32
Message-ID<qH3JE-6lu-27@gated-at.bofh.it>
In reply to#1293942
On Thu, Dec 17, 2015 at 03:38:16PM +0100, Andreas Schwab wrote:
> Yury Norov <ynorov@caviumnetworks.com> writes:
> 
> > From: Jan Dakinevich <jan.dakinevich@gmail.com>
> >
> > statfs64, fstat64 and mmap_pgoff has wrappers that needed both by aarch32 and
> 
> Typo: s/fstat64/fstatfs64/
> 
> Andreas.

Thank you.
--
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]


#1296750 — Re: [PATCH v6 13/20] arm64: ilp32: share aarch32 syscall wrappers to ilp32

FromCatalin Marinas <catalin.marinas@arm.com>
Date2015-12-22 13:30 +0100
SubjectRe: [PATCH v6 13/20] arm64: ilp32: share aarch32 syscall wrappers to ilp32
Message-ID<qIueK-3Tt-5@gated-at.bofh.it>
In reply to#1292564
On Wed, Dec 16, 2015 at 12:42:39AM +0300, Yury Norov wrote:
> statfs64, fstat64 and mmap_pgoff has wrappers that needed both by aarch32 and
> ilp32 to workaround some issues. Here we create common file to share aarch32
> workarounds to with ilp32 code.
[...]
> --- /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)

I'm not convinced we need these wrappers for ILP32. They've been
introduced on arch/arm many years ago by commit Fixes: 713c481519f1
([ARM] 3108/2: old ABI compat: statfs64 and fstatfs64) to deal with user
space passing a size of 88 (the EABI size of struct compat_statfs64
without the packing and alignment attribute). Since that commit, the
sizeof(struct compat_statfs64) is 84 already. This should be the case
with the new ILP32 exported headers (no backwards compatibility), so
user space should never pass 88 as size. Therefore we could call
compat_sys_(f)statfs64 directly without wrappers.

-- 
Catalin
--
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]


#1297079 — Re: [PATCH v6 13/20] arm64: ilp32: share aarch32 syscall wrappers to ilp32

FromArnd Bergmann <arnd@arndb.de>
Date2015-12-22 22:50 +0100
SubjectRe: [PATCH v6 13/20] arm64: ilp32: share aarch32 syscall wrappers to ilp32
Message-ID<qICYG-QF-35@gated-at.bofh.it>
In reply to#1296750
On Tuesday 22 December 2015, Catalin Marinas wrote:
> > +
> > +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)
> 
> I'm not convinced we need these wrappers for ILP32. They've been
> introduced on arch/arm many years ago by commit Fixes: 713c481519f1
> ([ARM] 3108/2: old ABI compat: statfs64 and fstatfs64) to deal with user
> space passing a size of 88 (the EABI size of struct compat_statfs64
> without the packing and alignment attribute). Since that commit, the
> sizeof(struct compat_statfs64) is 84 already. This should be the case
> with the new ILP32 exported headers (no backwards compatibility), so
> user space should never pass 88 as size. Therefore we could call
> compat_sys_(f)statfs64 directly without wrappers.

That means we have to set ARCH_PACK_STATFS64 in the arm64 header files
though, and propagate the OABI alignment to arm64/ilp32 as well, rather
than using the 88-byte version that every other 32-bit architecture
except for x86-32 and arm32 has.

Another option would be to set "#define __statfs_word __u64" and use
the 64-bit statfs call, instead of compat_sys_statfs64, but that in turn
requires special-casing statfs in libc.

	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]


#1297472 — Re: [PATCH v6 13/20] arm64: ilp32: share aarch32 syscall wrappers to ilp32

FromCatalin Marinas <catalin.marinas@arm.com>
Date2015-12-23 14:40 +0100
SubjectRe: [PATCH v6 13/20] arm64: ilp32: share aarch32 syscall wrappers to ilp32
Message-ID<qIRO2-1P2-29@gated-at.bofh.it>
In reply to#1297079
On Tue, Dec 22, 2015 at 10:44:14PM +0100, Arnd Bergmann wrote:
> On Tuesday 22 December 2015, Catalin Marinas wrote:
> > > +
> > > +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)
> > 
> > I'm not convinced we need these wrappers for ILP32. They've been
> > introduced on arch/arm many years ago by commit Fixes: 713c481519f1
> > ([ARM] 3108/2: old ABI compat: statfs64 and fstatfs64) to deal with user
> > space passing a size of 88 (the EABI size of struct compat_statfs64
> > without the packing and alignment attribute). Since that commit, the
> > sizeof(struct compat_statfs64) is 84 already. This should be the case
> > with the new ILP32 exported headers (no backwards compatibility), so
> > user space should never pass 88 as size. Therefore we could call
> > compat_sys_(f)statfs64 directly without wrappers.
> 
> That means we have to set ARCH_PACK_STATFS64 in the arm64 header files
> though, and propagate the OABI alignment to arm64/ilp32 as well, rather
> than using the 88-byte version that every other 32-bit architecture
> except for x86-32 and arm32 has.

Yuri replied that for EABI glibc, sizeof(struct statfs64) is already 88.
If that's correct and the packing attribute is ignored by glibc, we
could drop ARCH_PACK_COMPAT_STATFS64 as well (OABI not supported by
arm64). But I would be slightly worried since glibc is not the only user
of the kernel ABI.

For ILP32, I think we can skip defining ARCH_PACK_STATFS64 (of course,
only if __ILP32__) and state that sizeof(struct statfs64) is 88
(unpacked). In which case we need the wrappers above to be able to reuse
the compat_sys_statfs64 code.

> Another option would be to set "#define __statfs_word __u64" and use
> the 64-bit statfs call, instead of compat_sys_statfs64, but that in turn
> requires special-casing statfs in libc.

I wouldn't go this route as we kind of agreed that ILP32 should look
like any other 32-bit ABI.

-- 
Catalin
--
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]


#1297625 — Re: [PATCH v6 13/20] arm64: ilp32: share aarch32 syscall wrappers to ilp32

FromArnd Bergmann <arnd@arndb.de>
Date2015-12-23 21:50 +0100
SubjectRe: [PATCH v6 13/20] arm64: ilp32: share aarch32 syscall wrappers to ilp32
Message-ID<qIYwa-5TK-19@gated-at.bofh.it>
In reply to#1297472
On Wednesday 23 December 2015, Catalin Marinas wrote:
> > That means we have to set ARCH_PACK_STATFS64 in the arm64 header files
> > though, and propagate the OABI alignment to arm64/ilp32 as well, rather
> > than using the 88-byte version that every other 32-bit architecture
> > except for x86-32 and arm32 has.
> 
> Yuri replied that for EABI glibc, sizeof(struct statfs64) is already 88.
> If that's correct and the packing attribute is ignored by glibc, we
> could drop ARCH_PACK_COMPAT_STATFS64 as well (OABI not supported by
> arm64). But I would be slightly worried since glibc is not the only user
> of the kernel ABI.

It looks like glibc has its own definition of 'struct statfs64', which
is incompatible with the one in the kernel headers for ARM EABI.

However, there are other libc implementations besides glibc, and we
can't assume that they all do it the same way, so we clearly have to
keep using the wrapper for ARM EABI. For ARM64/ILP32, we are probably
better off defining it the same way in kernel and libc without that
wrapper.

> For ILP32, I think we can skip defining ARCH_PACK_STATFS64 (of course,
> only if __ILP32__) and state that sizeof(struct statfs64) is 88
> (unpacked). In which case we need the wrappers above to be able to reuse
> the compat_sys_statfs64 code.
> 
> > Another option would be to set "#define __statfs_word __u64" and use
> > the 64-bit statfs call, instead of compat_sys_statfs64, but that in turn
> > requires special-casing statfs in libc.
> 
> I wouldn't go this route as we kind of agreed that ILP32 should look
> like any other 32-bit ABI.

It's really tricky then: in order to support EABI binaries from a libc
that uses the kernel headers with the OABI compatible definition, we
must not copy the 88 byte structure to user space, because that would
overwrite user space stack data, and that in turn means we have to set
ARCH_PACK_COMPAT_STATFS64, but that in turn prevents us from using the
generic 32-bit syscall ABI for the arm64/ilp32 fstatfs64 call. 

It seems that today, put_compat_statfs64() doesn't actually use
the size argument, and it just copies the individual fields, which
is fine either way. This means we could turn around the logic
in the arm32 wrapper, remove ARCH_PACK_COMPAT_STATFS64, and make
the ilp32 code call directly into compat_sys_fstatfs64(), but it
would be a bit fragile, as we rely on put_compat_statfs64() not
actually writing the padding fields that the native do_statfs64()
writes. If someone changed them to both use copy_to_user, we'd
silently introduce data corruption on rarely used libc implementations.

	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]


#1299430 — Re: [PATCH v6 13/20] arm64: ilp32: share aarch32 syscall wrappers to ilp32

FromYury Norov <ynorov@caviumnetworks.com>
Date2015-12-30 18:30 +0100
SubjectRe: [PATCH v6 13/20] arm64: ilp32: share aarch32 syscall wrappers to ilp32
Message-ID<qLsJs-15B-7@gated-at.bofh.it>
In reply to#1297625
On Wed, Dec 23, 2015 at 09:41:54PM +0100, Arnd Bergmann wrote:
> On Wednesday 23 December 2015, Catalin Marinas wrote:
> > > That means we have to set ARCH_PACK_STATFS64 in the arm64 header files
> > > though, and propagate the OABI alignment to arm64/ilp32 as well, rather
> > > than using the 88-byte version that every other 32-bit architecture
> > > except for x86-32 and arm32 has.
> > 
> > Yuri replied that for EABI glibc, sizeof(struct statfs64) is already 88.
> > If that's correct and the packing attribute is ignored by glibc, we
> > could drop ARCH_PACK_COMPAT_STATFS64 as well (OABI not supported by
> > arm64). But I would be slightly worried since glibc is not the only user
> > of the kernel ABI.
> 
> It looks like glibc has its own definition of 'struct statfs64', which
> is incompatible with the one in the kernel headers for ARM EABI.
> 
> However, there are other libc implementations besides glibc, and we
> can't assume that they all do it the same way, so we clearly have to
> keep using the wrapper for ARM EABI. For ARM64/ILP32, we are probably
> better off defining it the same way in kernel and libc without that
> wrapper.
> 
> > For ILP32, I think we can skip defining ARCH_PACK_STATFS64 (of course,
> > only if __ILP32__) and state that sizeof(struct statfs64) is 88
> > (unpacked). In which case we need the wrappers above to be able to reuse
> > the compat_sys_statfs64 code.
> > 
> > > Another option would be to set "#define __statfs_word __u64" and use
> > > the 64-bit statfs call, instead of compat_sys_statfs64, but that in turn
> > > requires special-casing statfs in libc.
> > 
> > I wouldn't go this route as we kind of agreed that ILP32 should look
> > like any other 32-bit ABI.
> 
> It's really tricky then: in order to support EABI binaries from a libc
> that uses the kernel headers with the OABI compatible definition, we
> must not copy the 88 byte structure to user space, because that would
> overwrite user space stack data, and that in turn means we have to set
> ARCH_PACK_COMPAT_STATFS64, but that in turn prevents us from using the
> generic 32-bit syscall ABI for the arm64/ilp32 fstatfs64 call. 
> 
> It seems that today, put_compat_statfs64() doesn't actually use
> the size argument, and it just copies the individual fields, which
> is fine either way. This means we could turn around the logic
> in the arm32 wrapper, remove ARCH_PACK_COMPAT_STATFS64, and make
> the ilp32 code call directly into compat_sys_fstatfs64(), but it
> would be a bit fragile, as we rely on put_compat_statfs64() not
> actually writing the padding fields that the native do_statfs64()
> writes. If someone changed them to both use copy_to_user, we'd
> silently introduce data corruption on rarely used libc implementations.
> 
> 	Arnd

So. For ilp32, the only wrapper left here, is compat_sys_mmap2_wrapper.
But this is workaroud, as comment tells:
        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.

Not sure we should pull it to ILP32. If so, we can call sys_mmap_pgoff()
directly. And we don't need this patch at all therefore. Any throughts?

Yury.
--
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]


#1299527 — Re: [PATCH v6 13/20] arm64: ilp32: share aarch32 syscall wrappers to ilp32

FromArnd Bergmann <arnd@arndb.de>
Date2015-12-30 23:40 +0100
SubjectRe: [PATCH v6 13/20] arm64: ilp32: share aarch32 syscall wrappers to ilp32
Message-ID<qLxzs-48X-11@gated-at.bofh.it>
In reply to#1299430
On Wednesday 30 December 2015 20:29:05 Yury Norov wrote:
> 
> So. For ilp32, the only wrapper left here, is compat_sys_mmap2_wrapper.
> But this is workaroud, as comment tells:
>         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.
> 
> Not sure we should pull it to ILP32. If so, we can call sys_mmap_pgoff()
> directly. And we don't need this patch at all therefore. Any throughts?
> 
> 

I think providing the 64-bit version of sys_mmap() would be the simplest
API, as that avoids any possible confusion about the shift amount (hardcoded
12 bits vs PAGE_BITS). It fits in with the other syscalls that pass an loff_t
value here.

	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]


#1297247 — Re: [PATCH v6 13/20] arm64: ilp32: share aarch32 syscall wrappers to ilp32

FromYury Norov <ynorov@caviumnetworks.com>
Date2015-12-23 05:30 +0100
SubjectRe: [PATCH v6 13/20] arm64: ilp32: share aarch32 syscall wrappers to ilp32
Message-ID<qIJdN-4TG-25@gated-at.bofh.it>
In reply to#1296750
On Tue, Dec 22, 2015 at 12:25:15PM +0000, Catalin Marinas wrote:
> On Wed, Dec 16, 2015 at 12:42:39AM +0300, Yury Norov wrote:
> > statfs64, fstat64 and mmap_pgoff has wrappers that needed both by aarch32 and
> > ilp32 to workaround some issues. Here we create common file to share aarch32
> > workarounds to with ilp32 code.
> [...]
> > --- /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)
> 
> I'm not convinced we need these wrappers for ILP32. They've been
> introduced on arch/arm many years ago by commit Fixes: 713c481519f1
> ([ARM] 3108/2: old ABI compat: statfs64 and fstatfs64) to deal with user
> space passing a size of 88 (the EABI size of struct compat_statfs64
> without the packing and alignment attribute). Since that commit, the
> sizeof(struct compat_statfs64) is 84 already. This should be the case
> with the new ILP32 exported headers (no backwards compatibility), so
> user space should never pass 88 as size. Therefore we could call
> compat_sys_(f)statfs64 directly without wrappers.
> 

With current glibc, sizeof(struct compat_statfs64) is 88, so I added
wrappers just to make this couple of syscalls work. AFAIR, glibc
doesn't use exported headers here, so we'd change it. Maybe Andrew
will share more details.

> -- 
> Catalin
--
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]


#1292567 — [PATCH v6 08/20] arm64: ilp32: add is_ilp32_compat_{task,thread} and TIF_32BIT_AARCH64

FromYury Norov <ynorov@caviumnetworks.com>
Date2015-12-15 22:50 +0100
Subject[PATCH v6 08/20] arm64: ilp32: add is_ilp32_compat_{task,thread} and TIF_32BIT_AARCH64
Message-ID<qG5DQ-1iE-31@gated-at.bofh.it>
In reply to#1292558
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/is_compat.h   | 30 +++++++++++++++++++++++++++---
 arch/arm64/include/asm/thread_info.h |  1 +
 2 files changed, 28 insertions(+), 3 deletions(-)

diff --git a/arch/arm64/include/asm/is_compat.h b/arch/arm64/include/asm/is_compat.h
index 476db90..89b1f65 100644
--- a/arch/arm64/include/asm/is_compat.h
+++ b/arch/arm64/include/asm/is_compat.h
@@ -36,7 +36,6 @@ static inline int is_a32_compat_thread(struct thread_info *thread)
 #else
 
 static inline int is_a32_compat_task(void)
-
 {
 	return 0;
 }
@@ -45,14 +44,39 @@ static inline int is_a32_compat_thread(struct thread_info *thread)
 {
 	return 0;
 }
-
 #endif /* CONFIG_AARCH32_EL0 */
 
+#ifdef CONFIG_ARM64_ILP32
+
+static inline int is_ilp32_compat_task(void)
+{
+	return test_thread_flag(TIF_32BIT_AARCH64);
+}
+
+static inline int is_ilp32_compat_thread(struct thread_info *thread)
+{
+	return test_ti_thread_flag(thread, TIF_32BIT_AARCH64);
+}
+
+#else
+
+static inline int is_ilp32_compat_task(void)
+{
+	return 0;
+}
+
+static inline int is_ilp32_compat_thread(struct thread_info *thread)
+{
+	return 0;
+}
+
+#endif /* CONFIG_ARM64_ILP32 */
+
 #ifdef CONFIG_COMPAT
 
 static inline int is_compat_task(void)
 {
-	return is_a32_compat_task();
+	return is_a32_compat_task() || is_ilp32_compat_task();
 }
 
 #endif /* CONFIG_COMPAT */
diff --git a/arch/arm64/include/asm/thread_info.h b/arch/arm64/include/asm/thread_info.h
index 7d03565..e72de74 100644
--- a/arch/arm64/include/asm/thread_info.h
+++ b/arch/arm64/include/asm/thread_info.h
@@ -112,6 +112,7 @@ static inline struct thread_info *current_thread_info(void)
 #define TIF_SINGLESTEP		21
 #define TIF_32BIT		22	/* AARCH32 process */
 #define TIF_SWITCH_MM		23	/* deferred switch_mm */
+#define TIF_32BIT_AARCH64	24	/* 32 bit process on AArch64(ILP32) */
 
 #define _TIF_SIGPENDING		(1 << TIF_SIGPENDING)
 #define _TIF_NEED_RESCHED	(1 << TIF_NEED_RESCHED)
-- 
2.5.0

--
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]


#1293805 — Re: [PATCH v6 08/20] arm64: ilp32: add is_ilp32_compat_{task, thread} and TIF_32BIT_AARCH64

FromCatalin Marinas <catalin.marinas@arm.com>
Date2015-12-17 12:50 +0100
SubjectRe: [PATCH v6 08/20] arm64: ilp32: add is_ilp32_compat_{task, thread} and TIF_32BIT_AARCH64
Message-ID<qGFei-7iO-15@gated-at.bofh.it>
In reply to#1292567
On Wed, Dec 16, 2015 at 12:42:34AM +0300, Yury Norov wrote:
> 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>

Long description missing.

> diff --git a/arch/arm64/include/asm/is_compat.h b/arch/arm64/include/asm/is_compat.h
> index 476db90..89b1f65 100644
> --- a/arch/arm64/include/asm/is_compat.h
> +++ b/arch/arm64/include/asm/is_compat.h
> @@ -36,7 +36,6 @@ static inline int is_a32_compat_thread(struct thread_info *thread)
>  #else
>  
>  static inline int is_a32_compat_task(void)
> -
>  {
>  	return 0;
>  }

You should move this to the previous patch.

> @@ -45,14 +44,39 @@ static inline int is_a32_compat_thread(struct thread_info *thread)
>  {
>  	return 0;
>  }
> -
>  #endif /* CONFIG_AARCH32_EL0 */

Maybe this one as well, though I like an empty line before the last
#endif (i.e. drop this hunk).

-- 
Catalin
--
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]


#1294845 — Re: [PATCH v6 08/20] arm64: ilp32: add is_ilp32_compat_{task, thread} and TIF_32BIT_AARCH64

FromYury Norov <ynorov@caviumnetworks.com>
Date2015-12-18 15:20 +0100
SubjectRe: [PATCH v6 08/20] arm64: ilp32: add is_ilp32_compat_{task, thread} and TIF_32BIT_AARCH64
Message-ID<qH430-6Hj-27@gated-at.bofh.it>
In reply to#1293805
On Thu, Dec 17, 2015 at 11:41:53AM +0000, Catalin Marinas wrote:
> On Wed, Dec 16, 2015 at 12:42:34AM +0300, Yury Norov wrote:
> > 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>
> 
> Long description missing.

Hi, Catalin,

I think this patch (and patch #3 too) is trivial, and
explanation in patch name is clear enougth. So, I just do not
understand what else to explain here. Could you point me, and then I
will do it.

> 
> > diff --git a/arch/arm64/include/asm/is_compat.h b/arch/arm64/include/asm/is_compat.h
> > index 476db90..89b1f65 100644
> > --- a/arch/arm64/include/asm/is_compat.h
> > +++ b/arch/arm64/include/asm/is_compat.h
> > @@ -36,7 +36,6 @@ static inline int is_a32_compat_thread(struct thread_info *thread)
> >  #else
> >  
> >  static inline int is_a32_compat_task(void)
> > -
> >  {
> >  	return 0;
> >  }
> 
> You should move this to the previous patch.
> 
> > @@ -45,14 +44,39 @@ static inline int is_a32_compat_thread(struct thread_info *thread)
> >  {
> >  	return 0;
> >  }
> > -
> >  #endif /* CONFIG_AARCH32_EL0 */
> 
> Maybe this one as well, though I like an empty line before the last
> #endif (i.e. drop this hunk).

It's just dirt, I'll clean it. Thank you.

Yury.
--
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]


#1294928 — Re: [PATCH v6 08/20] arm64: ilp32: add is_ilp32_compat_{task, thread} and TIF_32BIT_AARCH64

FromYury Norov <ynorov@caviumnetworks.com>
Date2015-12-18 15:50 +0100
SubjectRe: [PATCH v6 08/20] arm64: ilp32: add is_ilp32_compat_{task, thread} and TIF_32BIT_AARCH64
Message-ID<qH4w2-6U7-23@gated-at.bofh.it>
In reply to#1294845
On Fri, Dec 18, 2015 at 05:11:12PM +0300, Yury Norov wrote:
> On Thu, Dec 17, 2015 at 11:41:53AM +0000, Catalin Marinas wrote:
> > On Wed, Dec 16, 2015 at 12:42:34AM +0300, Yury Norov wrote:
> > > 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>
> > 
> > Long description missing.
> 
> Hi, Catalin,
> 
> I think this patch (and patch #3 too) is trivial, and
> explanation in patch name is clear enougth. So, I just do not
> understand what else to explain here. Could you point me, and then I
> will do it.
> 

Is it OK?

arm64: ilp32: add is_ilp32_compat_{task,thread} and TIF_32BIT_AARCH64

ILP32 tasks are needed to be distinguished from lp64 and aarch32.
This patch adds helper functions is_ilp32_compat_{task,thread} and
thread flag TIF_32BIT_AARCH64 to address this. This patch is
preparation for following patches in ilp32 patchset.
--
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]


#1296121 — Re: [PATCH v6 08/20] arm64: ilp32: add is_ilp32_compat_{task, thread} and TIF_32BIT_AARCH64

FromCatalin Marinas <catalin.marinas@arm.com>
Date2015-12-21 18:50 +0100
SubjectRe: [PATCH v6 08/20] arm64: ilp32: add is_ilp32_compat_{task, thread} and TIF_32BIT_AARCH64
Message-ID<qIcKT-14N-27@gated-at.bofh.it>
In reply to#1294928
On Fri, Dec 18, 2015 at 05:44:37PM +0300, Yury Norov wrote:
> On Fri, Dec 18, 2015 at 05:11:12PM +0300, Yury Norov wrote:
> > On Thu, Dec 17, 2015 at 11:41:53AM +0000, Catalin Marinas wrote:
> > > On Wed, Dec 16, 2015 at 12:42:34AM +0300, Yury Norov wrote:
> > > > 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>
> > > 
> > > Long description missing.
> > 
> > Hi, Catalin,
> > 
> > I think this patch (and patch #3 too) is trivial, and
> > explanation in patch name is clear enougth. So, I just do not
> > understand what else to explain here. Could you point me, and then I
> > will do it.
> > 
> 
> Is it OK?
> 
> arm64: ilp32: add is_ilp32_compat_{task,thread} and TIF_32BIT_AARCH64
> 
> ILP32 tasks are needed to be distinguished from lp64 and aarch32.
> This patch adds helper functions is_ilp32_compat_{task,thread} and
> thread flag TIF_32BIT_AARCH64 to address this. This patch is
> preparation for following patches in ilp32 patchset.

It looks fine to me.

-- 
Catalin
--
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]


#1292569 — [PATCH v6 04/20] arm64: change some CONFIG_COMPAT over to use CONFIG_AARCH32_EL0 instead

FromYury Norov <ynorov@caviumnetworks.com>
Date2015-12-15 22:50 +0100
Subject[PATCH v6 04/20] arm64: change some CONFIG_COMPAT over to use CONFIG_AARCH32_EL0 instead
Message-ID<qG5DQ-1iE-35@gated-at.bofh.it>
In reply to#1292558
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/elf.h       | 11 ++++++++---
 arch/arm64/include/asm/fpsimd.h    |  2 +-
 arch/arm64/include/asm/processor.h |  4 ++--
 arch/arm64/include/asm/ptrace.h    |  2 +-
 arch/arm64/include/asm/signal32.h  |  6 ++++--
 arch/arm64/include/asm/unistd.h    |  7 +++++--
 arch/arm64/kernel/Makefile         |  2 +-
 arch/arm64/kernel/asm-offsets.c    |  2 +-
 arch/arm64/kernel/entry.S          |  6 +++---
 arch/arm64/kernel/head.S           |  2 +-
 arch/arm64/kernel/ptrace.c         | 27 ++++++++++++++++++++-------
 arch/arm64/kernel/traps.c          |  2 +-
 arch/arm64/kernel/vdso.c           |  4 ++--
 13 files changed, 50 insertions(+), 27 deletions(-)

diff --git a/arch/arm64/include/asm/elf.h b/arch/arm64/include/asm/elf.h
index faad6df..d255764 100644
--- a/arch/arm64/include/asm/elf.h
+++ b/arch/arm64/include/asm/elf.h
@@ -166,14 +166,16 @@ extern int arch_setup_additional_pages(struct linux_binprm *bprm,
 
 #define COMPAT_ELF_ET_DYN_BASE		(2 * TASK_SIZE_32 / 3)
 
+#ifdef CONFIG_AARCH32_EL0
+
 /* AArch32 registers. */
-#define COMPAT_ELF_NGREG		18
+#define COMPAT_A32_ELF_NGREG		18
 typedef unsigned int			compat_elf_greg_t;
-typedef compat_elf_greg_t		compat_elf_gregset_t[COMPAT_ELF_NGREG];
+typedef compat_elf_greg_t		compat_elf_gregset_t[COMPAT_A32_ELF_NGREG];
 
 /* AArch32 EABI. */
 #define EF_ARM_EABI_MASK		0xff000000
-#define compat_elf_check_arch(x)	(((x)->e_machine == EM_ARM) && \
+#define compat_a32_elf_check_arch(x)	(((x)->e_machine == EM_ARM) && \
 					 ((x)->e_flags & EF_ARM_EABI_MASK))
 
 #define compat_start_thread		compat_start_thread
@@ -183,6 +185,9 @@ extern int aarch32_setup_vectors_page(struct linux_binprm *bprm,
 				      int uses_interp);
 #define compat_arch_setup_additional_pages \
 					aarch32_setup_vectors_page
+#endif
+
+#define compat_elf_check_arch(x)	compat_a32_elf_check_arch(x)
 
 #endif /* CONFIG_COMPAT */
 
diff --git a/arch/arm64/include/asm/fpsimd.h b/arch/arm64/include/asm/fpsimd.h
index 50f559f..63b19f1 100644
--- a/arch/arm64/include/asm/fpsimd.h
+++ b/arch/arm64/include/asm/fpsimd.h
@@ -52,7 +52,7 @@ struct fpsimd_partial_state {
 };
 
 
-#if defined(__KERNEL__) && defined(CONFIG_COMPAT)
+#if defined(__KERNEL__) && defined(CONFIG_AARCH32_EL0)
 /* Masks for extracting the FPSR and FPCR from the FPSCR */
 #define VFP_FPSCR_STAT_MASK	0xf800009f
 #define VFP_FPSCR_CTRL_MASK	0x07f79f00
diff --git a/arch/arm64/include/asm/processor.h b/arch/arm64/include/asm/processor.h
index 98f3235..ff4abec 100644
--- a/arch/arm64/include/asm/processor.h
+++ b/arch/arm64/include/asm/processor.h
@@ -79,7 +79,7 @@ struct cpu_context {
 struct thread_struct {
 	struct cpu_context	cpu_context;	/* cpu context */
 	unsigned long		tp_value;	/* TLS register */
-#ifdef CONFIG_COMPAT
+#ifdef CONFIG_AARCH32_EL0
 	unsigned long		tp2_value;
 #endif
 	struct fpsimd_state	fpsimd_state;
@@ -88,7 +88,7 @@ struct thread_struct {
 	struct debug_info	debug;		/* debugging */
 };
 
-#ifdef CONFIG_COMPAT
+#ifdef CONFIG_AARCH32_EL0
 #define task_user_tls(t)						\
 ({									\
 	unsigned long *__tls;						\
diff --git a/arch/arm64/include/asm/ptrace.h b/arch/arm64/include/asm/ptrace.h
index 536274e..1059b3f 100644
--- a/arch/arm64/include/asm/ptrace.h
+++ b/arch/arm64/include/asm/ptrace.h
@@ -120,7 +120,7 @@ struct pt_regs {
 
 #define arch_has_single_step()	(1)
 
-#ifdef CONFIG_COMPAT
+#ifdef CONFIG_AARCH32_EL0
 #define compat_thumb_mode(regs) \
 	(((regs)->pstate & COMPAT_PSR_T_BIT))
 #else
diff --git a/arch/arm64/include/asm/signal32.h b/arch/arm64/include/asm/signal32.h
index eeaa975..e68fcce 100644
--- a/arch/arm64/include/asm/signal32.h
+++ b/arch/arm64/include/asm/signal32.h
@@ -17,7 +17,9 @@
 #define __ASM_SIGNAL32_H
 
 #ifdef __KERNEL__
-#ifdef CONFIG_COMPAT
+
+#ifdef CONFIG_AARCH32_EL0
+
 #include <linux/compat.h>
 
 #define AARCH32_KERN_SIGRET_CODE_OFFSET	0x500
@@ -47,6 +49,6 @@ static inline int compat_setup_rt_frame(int usig, struct ksignal *ksig, sigset_t
 static inline void compat_setup_restart_syscall(struct pt_regs *regs)
 {
 }
-#endif /* CONFIG_COMPAT */
+#endif /* CONFIG_AARCH32_EL0 */
 #endif /* __KERNEL__ */
 #endif /* __ASM_SIGNAL32_H */
diff --git a/arch/arm64/include/asm/unistd.h b/arch/arm64/include/asm/unistd.h
index 41e58fe..e6216ef 100644
--- a/arch/arm64/include/asm/unistd.h
+++ b/arch/arm64/include/asm/unistd.h
@@ -13,9 +13,8 @@
  * 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_COMPAT
+#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
@@ -26,7 +25,9 @@
 #define __ARCH_WANT_COMPAT_SYS_SENDFILE
 #define __ARCH_WANT_SYS_FORK
 #define __ARCH_WANT_SYS_VFORK
+#endif
 
+#ifdef CONFIG_COMPAT
 /*
  * Compat syscall numbers used by the AArch64 kernel.
  */
@@ -44,6 +45,8 @@
 #define __ARM_NR_compat_cacheflush	(__ARM_NR_COMPAT_BASE+2)
 #define __ARM_NR_compat_set_tls		(__ARM_NR_COMPAT_BASE+5)
 
+#define __ARCH_WANT_COMPAT_STAT64
+
 #define __NR_compat_syscalls		390
 #endif
 
diff --git a/arch/arm64/kernel/Makefile b/arch/arm64/kernel/Makefile
index 22dc9bc..1470332 100644
--- a/arch/arm64/kernel/Makefile
+++ b/arch/arm64/kernel/Makefile
@@ -20,7 +20,7 @@ arm64-obj-y		:= debug-monitors.o entry.o irq.o fpsimd.o		\
 			   cpufeature.o alternative.o cacheinfo.o		\
 			   smp.o smp_spin_table.o topology.o
 
-arm64-obj-$(CONFIG_COMPAT)		+= sys32.o kuser32.o signal32.o 	\
+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
diff --git a/arch/arm64/kernel/asm-offsets.c b/arch/arm64/kernel/asm-offsets.c
index 8d89cf8..e3bcf77 100644
--- a/arch/arm64/kernel/asm-offsets.c
+++ b/arch/arm64/kernel/asm-offsets.c
@@ -51,7 +51,7 @@ int main(void)
   DEFINE(S_X7,			offsetof(struct pt_regs, regs[7]));
   DEFINE(S_LR,			offsetof(struct pt_regs, regs[30]));
   DEFINE(S_SP,			offsetof(struct pt_regs, sp));
-#ifdef CONFIG_COMPAT
+#ifdef CONFIG_AARCH32_EL0
   DEFINE(S_COMPAT_SP,		offsetof(struct pt_regs, compat_sp));
 #endif
   DEFINE(S_PSTATE,		offsetof(struct pt_regs, pstate));
diff --git a/arch/arm64/kernel/entry.S b/arch/arm64/kernel/entry.S
index 4306c93..52be5c8 100644
--- a/arch/arm64/kernel/entry.S
+++ b/arch/arm64/kernel/entry.S
@@ -212,7 +212,7 @@ ENTRY(vectors)
 	ventry	el0_fiq_invalid			// FIQ 64-bit EL0
 	ventry	el0_error_invalid		// Error 64-bit EL0
 
-#ifdef CONFIG_COMPAT
+#ifdef CONFIG_AARCH32_EL0
 	ventry	el0_sync_compat			// Synchronous 32-bit EL0
 	ventry	el0_irq_compat			// IRQ 32-bit EL0
 	ventry	el0_fiq_invalid_compat		// FIQ 32-bit EL0
@@ -252,7 +252,7 @@ el0_error_invalid:
 	inv_entry 0, BAD_ERROR
 ENDPROC(el0_error_invalid)
 
-#ifdef CONFIG_COMPAT
+#ifdef CONFIG_AARCH32_EL0
 el0_fiq_invalid_compat:
 	inv_entry 0, BAD_FIQ, 32
 ENDPROC(el0_fiq_invalid_compat)
@@ -414,7 +414,7 @@ el0_sync:
 	b.ge	el0_dbg
 	b	el0_inv
 
-#ifdef CONFIG_COMPAT
+#ifdef CONFIG_AARCH32_EL0
 	.align	6
 el0_sync_compat:
 	kernel_entry 0, 32
diff --git a/arch/arm64/kernel/head.S b/arch/arm64/kernel/head.S
index 90d09ed..d11d0b2 100644
--- a/arch/arm64/kernel/head.S
+++ b/arch/arm64/kernel/head.S
@@ -519,7 +519,7 @@ CPU_LE(	movk	x0, #0x30d0, lsl #16	)	// Clear EE and E0E on LE systems
 	mov	x0, #0x33ff
 	msr	cptr_el2, x0			// Disable copro. traps to EL2
 
-#ifdef CONFIG_COMPAT
+#ifdef CONFIG_AARCH32_EL0
 	msr	hstr_el2, xzr			// Disable CP15 traps to EL2
 #endif
 
diff --git a/arch/arm64/kernel/ptrace.c b/arch/arm64/kernel/ptrace.c
index 1971f49..2a39b5d 100644
--- a/arch/arm64/kernel/ptrace.c
+++ b/arch/arm64/kernel/ptrace.c
@@ -76,7 +76,7 @@ static void ptrace_hbptriggered(struct perf_event *bp,
 		.si_addr	= (void __user *)(bkpt->trigger),
 	};
 
-#ifdef CONFIG_COMPAT
+#ifdef CONFIG_AARCH32_EL0
 	int i;
 
 	if (!is_compat_task())
@@ -651,7 +651,7 @@ static const struct user_regset_view user_aarch64_view = {
 	.regsets = aarch64_regsets, .n = ARRAY_SIZE(aarch64_regsets)
 };
 
-#ifdef CONFIG_COMPAT
+#ifdef CONFIG_AARCH32_EL0
 #include <linux/compat.h>
 
 enum compat_regset {
@@ -853,7 +853,7 @@ static int compat_tls_set(struct task_struct *target,
 static const struct user_regset aarch32_regsets[] = {
 	[REGSET_COMPAT_GPR] = {
 		.core_note_type = NT_PRSTATUS,
-		.n = COMPAT_ELF_NGREG,
+		.n = COMPAT_A32_ELF_NGREG,
 		.size = sizeof(compat_elf_greg_t),
 		.align = sizeof(compat_elf_greg_t),
 		.get = compat_gpr_get,
@@ -877,7 +877,7 @@ static const struct user_regset_view user_aarch32_view = {
 static const struct user_regset aarch32_ptrace_regsets[] = {
 	[REGSET_GPR] = {
 		.core_note_type = NT_PRSTATUS,
-		.n = COMPAT_ELF_NGREG,
+		.n = COMPAT_A32_ELF_NGREG,
 		.size = sizeof(compat_elf_greg_t),
 		.align = sizeof(compat_elf_greg_t),
 		.get = compat_gpr_get,
@@ -1109,7 +1109,7 @@ static int compat_ptrace_sethbpregs(struct task_struct *tsk, compat_long_t num,
 }
 #endif	/* CONFIG_HAVE_HW_BREAKPOINT */
 
-long compat_arch_ptrace(struct task_struct *child, compat_long_t request,
+long compat_a32_arch_ptrace(struct task_struct *child, compat_long_t request,
 			compat_ulong_t caddr, compat_ulong_t cdata)
 {
 	unsigned long addr = caddr;
@@ -1186,11 +1186,24 @@ long compat_arch_ptrace(struct task_struct *child, compat_long_t request,
 
 	return ret;
 }
-#endif /* CONFIG_COMPAT */
+#else /* !CONFIG_AARCH32_EL0 */
+#define compat_a32_arch_ptrace(child, request, caddr, cdata) (-1)
+#endif /* !CONFIG_AARCH32_EL0 */
+
+#ifdef CONFIG_COMPAT
+long compat_arch_ptrace(struct task_struct *child, compat_long_t request,
+			compat_ulong_t caddr, compat_ulong_t cdata)
+{
+	if (is_compat_task())
+		return compat_a32_arch_ptrace(child, request, caddr, cdata);
+	return compat_ptrace_request(child, request, caddr, cdata);
+}
+#endif
+
 
 const struct user_regset_view *task_user_regset_view(struct task_struct *task)
 {
-#ifdef CONFIG_COMPAT
+#ifdef CONFIG_AARCH32_EL0
 	/*
 	 * Core dumping of 32-bit tasks or compat ptrace requests must use the
 	 * user_aarch32_view compatible with arm32. Native ptrace requests on
diff --git a/arch/arm64/kernel/traps.c b/arch/arm64/kernel/traps.c
index f93aae5..9ce9894 100644
--- a/arch/arm64/kernel/traps.c
+++ b/arch/arm64/kernel/traps.c
@@ -363,7 +363,7 @@ long compat_arm_syscall(struct pt_regs *regs);
 
 asmlinkage long do_ni_syscall(struct pt_regs *regs)
 {
-#ifdef CONFIG_COMPAT
+#ifdef CONFIG_AARCH32_EL0
 	long ret;
 	if (is_compat_task()) {
 		ret = compat_arm_syscall(regs);
diff --git a/arch/arm64/kernel/vdso.c b/arch/arm64/kernel/vdso.c
index 97bc68f..26352a6 100644
--- a/arch/arm64/kernel/vdso.c
+++ b/arch/arm64/kernel/vdso.c
@@ -49,7 +49,7 @@ static union {
 } vdso_data_store __page_aligned_data;
 struct vdso_data *vdso_data = &vdso_data_store.data;
 
-#ifdef CONFIG_COMPAT
+#ifdef CONFIG_AARCH32_EL0
 /*
  * Create and map the vectors page for AArch32 tasks.
  */
@@ -107,7 +107,7 @@ int aarch32_setup_vectors_page(struct linux_binprm *bprm, int uses_interp)
 
 	return PTR_ERR_OR_ZERO(ret);
 }
-#endif /* CONFIG_COMPAT */
+#endif /* CONFIG_AARCH32_EL0 */
 
 static struct vm_special_mapping vdso_spec[2];
 
-- 
2.5.0

--
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]


#1297485 — Re: [PATCH v6 04/20] arm64: change some CONFIG_COMPAT over to use CONFIG_AARCH32_EL0 instead

FromYury Norov <ynorov@caviumnetworks.com>
Date2015-12-23 15:20 +0100
SubjectRe: [PATCH v6 04/20] arm64: change some CONFIG_COMPAT over to use CONFIG_AARCH32_EL0 instead
Message-ID<qISqK-2fv-15@gated-at.bofh.it>
In reply to#1292569
On Wed, Dec 16, 2015 at 12:42:30AM +0300, Yury Norov wrote:
> --- a/arch/arm64/include/asm/unistd.h
> +++ b/arch/arm64/include/asm/unistd.h
> @@ -13,9 +13,8 @@
>   * 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_COMPAT
> +#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
> @@ -26,7 +25,9 @@
>  #define __ARCH_WANT_COMPAT_SYS_SENDFILE
>  #define __ARCH_WANT_SYS_FORK
>  #define __ARCH_WANT_SYS_VFORK
> +#endif
>  
> +#ifdef CONFIG_COMPAT

It seems like __NR_compat_* and __ARM_NR_compat_*
are needed by aarch32 only. If so, it should not be
defined for ilp32. And the only common definition
here would be __ARCH_WANT_COMPAT_STAT64.

>  /*
>   * Compat syscall numbers used by the AArch64 kernel.
>   */
> @@ -44,6 +45,8 @@
>  #define __ARM_NR_compat_cacheflush	(__ARM_NR_COMPAT_BASE+2)
>  #define __ARM_NR_compat_set_tls		(__ARM_NR_COMPAT_BASE+5)
>  
> +#define __ARCH_WANT_COMPAT_STAT64
> +
>  #define __NR_compat_syscalls		390
>  #endif
--
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]


#1298540 — > diff --git a/arch/arm64/kernel/Makefile b/arch/arm64/kernel/Makefile

FromBamvor Jian Zhang <bamvor.zhangjian@linaro.org>
Date2015-12-28 09:50 +0100
Subject> diff --git a/arch/arm64/kernel/Makefile b/arch/arm64/kernel/Makefile
Message-ID<qKBF7-7T9-11@gated-at.bofh.it>
In reply to#1292569
I feel we need something like this to avoid the failure of compiling
when build with ARM64_ILP32(which will select COMPAT) and
ARMV8_DEPRECATED (which depends on the opcodes.o).

From f8b8ffdb449491ecf8ba465238bbdb4625a74ac0 Mon Sep 17 00:00:00 2001
From: Bamvor Jian Zhang <bamvor.zhangjian@linaro.org>
Date: Mon, 28 Dec 2015 12:57:46 +0800
Subject: [PATCH] arm64: compat: fix wrong dependency of ARMV8_DEPRECATED

When compile with ARM64_ILP32, ARMV8_DEPRECATED will be selected due
to the dependency of COMPAT. It leads to the following error:
    LD      init/built-in.o
    arch/arm64/kernel/built-in.o: In function `cp15barrier_handler':
    /home/bamvor/works/source/kernel/linux_ilp32/arch/arm64/kernel/armv8_deprecated.c:467: undefined reference to `arm_check_condition'
    /home/bamvor/works/source/kernel/linux_ilp32/arch/arm64/kernel/armv8_deprecated.c:467: undefined reference to `arm_check_condition'
    arch/arm64/kernel/built-in.o: In function `swp_handler':
    /home/bamvor/works/source/kernel/linux_ilp32/arch/arm64/kernel/armv8_deprecated.c:386: undefined reference to `arm_check_condition'
    /home/bamvor/works/source/kernel/linux_ilp32/arch/arm64/kernel/armv8_deprecated.c:386: undefined reference to `arm_check_condition'
    Makefile:927: recipe for target 'vmlinux' failed
    make: *** [vmlinux] Error 1

This patch fix this by updating the dependency from COMPAT to
AARCH32_EL0.

Signed-off-by: Bamvor Jian Zhang <bamvor.zhangjian@linaro.org>
---
 arch/arm64/Kconfig | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/arm64/Kconfig b/arch/arm64/Kconfig
index deec37a..e52fd03 100644
--- a/arch/arm64/Kconfig
+++ b/arch/arm64/Kconfig
@@ -509,7 +509,7 @@ config FORCE_MAX_ZONEORDER
 
 menuconfig ARMV8_DEPRECATED
 	bool "Emulate deprecated/obsolete ARMv8 instructions"
-	depends on COMPAT
+	depends on AARCH32_EL0
 	help
 	  Legacy software support may require certain instructions
 	  that have been deprecated or obsoleted in the architecture.
-- 
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]


#1298550 — Re: [PATCH v6 04/20] arm64: change some CONFIG_COMPAT over to use CONFIG_AARCH32_EL0 instead

From"Zhangjian (Bamvor)" <bamvor.zhangjian@huawei.com>
Date2015-12-28 10:10 +0100
SubjectRe: [PATCH v6 04/20] arm64: change some CONFIG_COMPAT over to use CONFIG_AARCH32_EL0 instead
Message-ID<qKBYu-8fe-23@gated-at.bofh.it>
In reply to#1298540
Fix the title.

On 16:43 2015/12/28, Bamvor Jian Zhang wrote:
> I feel we need something like this to avoid the failure of compiling
> when build with ARM64_ILP32(which will select COMPAT) and
> ARMV8_DEPRECATED (which depends on the opcodes.o).
>
>  From f8b8ffdb449491ecf8ba465238bbdb4625a74ac0 Mon Sep 17 00:00:00 2001
> From: Bamvor Jian Zhang <bamvor.zhangjian@linaro.org>
> Date: Mon, 28 Dec 2015 12:57:46 +0800
> Subject: [PATCH] arm64: compat: fix wrong dependency of ARMV8_DEPRECATED
>
> When compile with ARM64_ILP32, ARMV8_DEPRECATED will be selected due
> to the dependency of COMPAT. It leads to the following error:
>      LD      init/built-in.o
>      arch/arm64/kernel/built-in.o: In function `cp15barrier_handler':
>      /home/bamvor/works/source/kernel/linux_ilp32/arch/arm64/kernel/armv8_deprecated.c:467: undefined reference to `arm_check_condition'
>      /home/bamvor/works/source/kernel/linux_ilp32/arch/arm64/kernel/armv8_deprecated.c:467: undefined reference to `arm_check_condition'
>      arch/arm64/kernel/built-in.o: In function `swp_handler':
>      /home/bamvor/works/source/kernel/linux_ilp32/arch/arm64/kernel/armv8_deprecated.c:386: undefined reference to `arm_check_condition'
>      /home/bamvor/works/source/kernel/linux_ilp32/arch/arm64/kernel/armv8_deprecated.c:386: undefined reference to `arm_check_condition'
>      Makefile:927: recipe for target 'vmlinux' failed
>      make: *** [vmlinux] Error 1
>
> This patch fix this by updating the dependency from COMPAT to
> AARCH32_EL0.
>
> Signed-off-by: Bamvor Jian Zhang <bamvor.zhangjian@linaro.org>
> ---
>   arch/arm64/Kconfig | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/arch/arm64/Kconfig b/arch/arm64/Kconfig
> index deec37a..e52fd03 100644
> --- a/arch/arm64/Kconfig
> +++ b/arch/arm64/Kconfig
> @@ -509,7 +509,7 @@ config FORCE_MAX_ZONEORDER
>
>   menuconfig ARMV8_DEPRECATED
>   	bool "Emulate deprecated/obsolete ARMv8 instructions"
> -	depends on COMPAT
> +	depends on AARCH32_EL0
>   	help
>   	  Legacy software support may require certain instructions
>   	  that have been deprecated or obsoleted in the architecture.
>

--
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]


#1298974 — Re: [PATCH v6 04/20] arm64: change some CONFIG_COMPAT over to use CONFIG_AARCH32_EL0 instead

FromYury Norov <ynorov@caviumnetworks.com>
Date2015-12-29 13:40 +0100
SubjectRe: [PATCH v6 04/20] arm64: change some CONFIG_COMPAT over to use CONFIG_AARCH32_EL0 instead
Message-ID<qL1Jh-xv-25@gated-at.bofh.it>
In reply to#1298550
On Mon, Dec 28, 2015 at 05:01:15PM +0800, Zhangjian (Bamvor) wrote:
> Fix the title.
> 
> On 16:43 2015/12/28, Bamvor Jian Zhang wrote:
> >I feel we need something like this to avoid the failure of compiling
> >when build with ARM64_ILP32(which will select COMPAT) and
> >ARMV8_DEPRECATED (which depends on the opcodes.o).
> >
> > From f8b8ffdb449491ecf8ba465238bbdb4625a74ac0 Mon Sep 17 00:00:00 2001
> >From: Bamvor Jian Zhang <bamvor.zhangjian@linaro.org>
> >Date: Mon, 28 Dec 2015 12:57:46 +0800
> >Subject: [PATCH] arm64: compat: fix wrong dependency of ARMV8_DEPRECATED
> >
> >When compile with ARM64_ILP32, ARMV8_DEPRECATED will be selected due
> >to the dependency of COMPAT. It leads to the following error:
> >     LD      init/built-in.o
> >     arch/arm64/kernel/built-in.o: In function `cp15barrier_handler':
> >     /home/bamvor/works/source/kernel/linux_ilp32/arch/arm64/kernel/armv8_deprecated.c:467: undefined reference to `arm_check_condition'
> >     /home/bamvor/works/source/kernel/linux_ilp32/arch/arm64/kernel/armv8_deprecated.c:467: undefined reference to `arm_check_condition'
> >     arch/arm64/kernel/built-in.o: In function `swp_handler':
> >     /home/bamvor/works/source/kernel/linux_ilp32/arch/arm64/kernel/armv8_deprecated.c:386: undefined reference to `arm_check_condition'
> >     /home/bamvor/works/source/kernel/linux_ilp32/arch/arm64/kernel/armv8_deprecated.c:386: undefined reference to `arm_check_condition'
> >     Makefile:927: recipe for target 'vmlinux' failed
> >     make: *** [vmlinux] Error 1
> >
> >This patch fix this by updating the dependency from COMPAT to
> >AARCH32_EL0.
> >
> >Signed-off-by: Bamvor Jian Zhang <bamvor.zhangjian@linaro.org>
> >---
> >  arch/arm64/Kconfig | 2 +-
> >  1 file changed, 1 insertion(+), 1 deletion(-)
> >
> >diff --git a/arch/arm64/Kconfig b/arch/arm64/Kconfig
> >index deec37a..e52fd03 100644
> >--- a/arch/arm64/Kconfig
> >+++ b/arch/arm64/Kconfig
> >@@ -509,7 +509,7 @@ config FORCE_MAX_ZONEORDER
> >
> >  menuconfig ARMV8_DEPRECATED
> >  	bool "Emulate deprecated/obsolete ARMv8 instructions"
> >-	depends on COMPAT
> >+	depends on AARCH32_EL0
> >  	help
> >  	  Legacy software support may require certain instructions
> >  	  that have been deprecated or obsoleted in the architecture.
> >

Thanks for catch. I will incorporate it to next submission. I also
think, config ARM64_ERRATUM_845719 should depend on AARCH32_EL0 as
well.
--
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 2 of 4 — ← Prev page 1 [2] 3 4  Next page →

Back to top | Article view | linux.kernel


csiph-web