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


Groups > linux.kernel > #1443721 > unrolled thread

Re: [PATCH] Add compat_sys_preadv64v2/compat_sys_pwritev64v2

Started by"H.J. Lu" <hjl.tools@gmail.com>
First post2016-07-14 21:40 +0200
Last post2016-07-15 14:10 +0200
Articles 2 — 2 participants

Back to article view | Back to linux.kernel

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  Re: [PATCH] Add compat_sys_preadv64v2/compat_sys_pwritev64v2 "H.J. Lu" <hjl.tools@gmail.com> - 2016-07-14 21:40 +0200
    [tip:x86/mm] x86/syscalls: Add  compat_sys_preadv64v2/compat_sys_pwritev64v2 "tip-bot for H.J. Lu" <tipbot@zytor.com> - 2016-07-15 14:10 +0200

#1443721 — Re: [PATCH] Add compat_sys_preadv64v2/compat_sys_pwritev64v2

From"H.J. Lu" <hjl.tools@gmail.com>
Date2016-07-14 21:40 +0200
SubjectRe: [PATCH] Add compat_sys_preadv64v2/compat_sys_pwritev64v2
Message-ID<rUUEi-5mr-43@gated-at.bofh.it>

[Multipart message — attachments visible in raw view] — view raw

On Thu, Jul 14, 2016 at 12:01 PM, Ingo Molnar <mingo@kernel.org> wrote:
>
> * H.J. Lu <hjl.tools@gmail.com> wrote:
>
>> Add compat_sys_preadv64v2 and compat_sys_pwritev64v2 so that 64-bit offset
>> is passed in one 64-bit register on x32, similar to compat_sys_preadv64
>> and compat_sys_pwritev64.
>>
>> Signed-off-by: H.J. Lu <hjl.tools@gmail.com>
>
>> From 100f17970625dfeb27539a4bb2470acefe3982e1 Mon Sep 17 00:00:00 2001
>> From: "H.J. Lu" <hjl.tools@gmail.com>
>> Date: Thu, 14 Jul 2016 08:42:12 -0700
>> Subject: [PATCH] Add compat_sys_preadv64v2/compat_sys_pwritev64v2
>>
>> Add compat_sys_preadv64v2 and compat_sys_pwritev64v2 so that 64-bit offset
>> is passed in one 64-bit register on x32, similar to compat_sys_preadv64
>> and compat_sys_pwritev64.
>>
>> Signed-off-by: H.J. Lu <hjl.tools@gmail.com>
>> ---
>>  arch/x86/entry/syscalls/syscall_64.tbl |  2 ++
>>  arch/x86/include/asm/unistd.h          |  2 ++
>>  fs/read_write.c                        | 18 ++++++++++++++++++
>>  3 files changed, 22 insertions(+)
>
> Could you please send this against the latest upstream kernel, such as v4.7-rc7?
> The patch does not apply cleanly:
>
> patching file arch/x86/entry/syscalls/syscall_64.tbl
> Hunk #1 FAILED at 374.
> 1 out of 1 hunk FAILED -- rejects in file arch/x86/entry/syscalls/syscall_64.tbl
> patching file arch/x86/include/asm/unistd.h
> patching file fs/read_write.c
> Hunk #1 succeeded at 1168 (offset -14 lines).
> Hunk #2 succeeded at 1274 (offset -14 lines).
>
> Also, could you please Cc: linux-kernel@vger.kernel.org to patch submissions?
>
> Thanks,

Here is the updated patch.

-- 
H.J.

[toc] | [next] | [standalone]


#1444233 — [tip:x86/mm] x86/syscalls: Add compat_sys_preadv64v2/compat_sys_pwritev64v2

From"tip-bot for H.J. Lu" <tipbot@zytor.com>
Date2016-07-15 14:10 +0200
Subject[tip:x86/mm] x86/syscalls: Add compat_sys_preadv64v2/compat_sys_pwritev64v2
Message-ID<rVa6n-6K7-39@gated-at.bofh.it>
In reply to#1443721
Commit-ID:  3ebfd81f7fb3e81a754e37283b7f38c62244641a
Gitweb:     http://git.kernel.org/tip/3ebfd81f7fb3e81a754e37283b7f38c62244641a
Author:     H.J. Lu <hjl.tools@gmail.com>
AuthorDate: Thu, 14 Jul 2016 12:31:53 -0700
Committer:  Ingo Molnar <mingo@kernel.org>
CommitDate: Fri, 15 Jul 2016 10:30:26 +0200

x86/syscalls: Add compat_sys_preadv64v2/compat_sys_pwritev64v2

Don't use the same syscall numbers for 2 different syscalls:

 534	x32	preadv			compat_sys_preadv64
 535	x32	pwritev			compat_sys_pwritev64
 534	x32	preadv2			compat_sys_preadv2
 535	x32	pwritev2		compat_sys_pwritev2

Add compat_sys_preadv64v2() and compat_sys_pwritev64v2() so that 64-bit offset
is passed in one 64-bit register on x32, similar to compat_sys_preadv64()
and compat_sys_pwritev64().

Signed-off-by: H.J. Lu <hjl.tools@gmail.com>
Cc: Andy Lutomirski <luto@kernel.org>
Cc: Borislav Petkov <bp@alien8.de>
Cc: Brian Gerst <brgerst@gmail.com>
Cc: Christoph Hellwig <hch@lst.de>
Cc: Denys Vlasenko <dvlasenk@redhat.com>
Cc: H. Peter Anvin <hpa@zytor.com>
Cc: Josh Poimboeuf <jpoimboe@redhat.com>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
Link: http://lkml.kernel.org/r/CAMe9rOovCMf-RQfx_n1U_Tu_DX1BYkjtFr%3DQ4-_PFVSj9BCzUA@mail.gmail.com
Signed-off-by: Ingo Molnar <mingo@kernel.org>
---
 arch/x86/entry/syscalls/syscall_64.tbl |  4 ++--
 arch/x86/include/asm/unistd.h          |  2 ++
 fs/read_write.c                        | 18 ++++++++++++++++++
 3 files changed, 22 insertions(+), 2 deletions(-)

diff --git a/arch/x86/entry/syscalls/syscall_64.tbl b/arch/x86/entry/syscalls/syscall_64.tbl
index 555263e..e9ce9c7 100644
--- a/arch/x86/entry/syscalls/syscall_64.tbl
+++ b/arch/x86/entry/syscalls/syscall_64.tbl
@@ -374,5 +374,5 @@
 543	x32	io_setup		compat_sys_io_setup
 544	x32	io_submit		compat_sys_io_submit
 545	x32	execveat		compat_sys_execveat/ptregs
-534	x32	preadv2			compat_sys_preadv2
-535	x32	pwritev2		compat_sys_pwritev2
+546	x32	preadv2			compat_sys_preadv64v2
+547	x32	pwritev2		compat_sys_pwritev64v2
diff --git a/arch/x86/include/asm/unistd.h b/arch/x86/include/asm/unistd.h
index 2b19caa..32712a9 100644
--- a/arch/x86/include/asm/unistd.h
+++ b/arch/x86/include/asm/unistd.h
@@ -26,6 +26,8 @@
 #  define __ARCH_WANT_COMPAT_SYS_GETDENTS64
 #  define __ARCH_WANT_COMPAT_SYS_PREADV64
 #  define __ARCH_WANT_COMPAT_SYS_PWRITEV64
+#  define __ARCH_WANT_COMPAT_SYS_PREADV64V2
+#  define __ARCH_WANT_COMPAT_SYS_PWRITEV64V2
 
 # endif
 
diff --git a/fs/read_write.c b/fs/read_write.c
index 933b53a..66215a7 100644
--- a/fs/read_write.c
+++ b/fs/read_write.c
@@ -1168,6 +1168,15 @@ COMPAT_SYSCALL_DEFINE5(preadv, compat_ulong_t, fd,
 	return do_compat_preadv64(fd, vec, vlen, pos, 0);
 }
 
+#ifdef __ARCH_WANT_COMPAT_SYS_PREADV64V2
+COMPAT_SYSCALL_DEFINE5(preadv64v2, unsigned long, fd,
+		const struct compat_iovec __user *,vec,
+		unsigned long, vlen, loff_t, pos, int, flags)
+{
+	return do_compat_preadv64(fd, vec, vlen, pos, flags);
+}
+#endif
+
 COMPAT_SYSCALL_DEFINE6(preadv2, compat_ulong_t, fd,
 		const struct compat_iovec __user *,vec,
 		compat_ulong_t, vlen, u32, pos_low, u32, pos_high,
@@ -1265,6 +1274,15 @@ COMPAT_SYSCALL_DEFINE5(pwritev, compat_ulong_t, fd,
 	return do_compat_pwritev64(fd, vec, vlen, pos, 0);
 }
 
+#ifdef __ARCH_WANT_COMPAT_SYS_PWRITEV64V2
+COMPAT_SYSCALL_DEFINE5(pwritev64v2, unsigned long, fd,
+		const struct compat_iovec __user *,vec,
+		unsigned long, vlen, loff_t, pos, int, flags)
+{
+	return do_compat_pwritev64(fd, vec, vlen, pos, flags);
+}
+#endif
+
 COMPAT_SYSCALL_DEFINE6(pwritev2, compat_ulong_t, fd,
 		const struct compat_iovec __user *,vec,
 		compat_ulong_t, vlen, u32, pos_low, u32, pos_high, int, flags)

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web