Thread (76 messages) 76 messages, 7 authors, 2016-01-07

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

From: catalin.marinas@arm.com (Catalin Marinas)
Date: 2015-12-22 12:25:22
Also in: lkml

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.
[...]
quoted hunk ↗ jump to hunk
--- /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
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help