* [PATCH 3/5] FS: Export poll_select_copy_remaining and rename poll_select_copy_remaining in compat.c so it does not pick the wrong copy.
[not found] <1378762380-13152-1-git-send-email-apinski@cavium.com>
2013-09-09 21:32 ` [PATCH 3/5] FS: Export poll_select_copy_remaining and rename poll_select_copy_remaining in compat.c so it does not pick the wrong copy Andrew Pinski
2013-09-09 21:32 ` Andrew Pinski
@ 2013-09-09 21:32 ` Andrew Pinski
2013-09-11 11:09 ` Catalin Marinas
2 siblings, 1 reply; 6+ messages in thread
From: Andrew Pinski @ 2013-09-09 21:32 UTC (permalink / raw)
To: linux-arm-kernel, linux-kernel, Alexander Viro, linux-fsdevel,
linux-kernel
Cc: Andrew Pinski, Alexander Viro, linux-fsdevel
Hi,
The ILP32 ABI in ARM64 uses a slightly different pselect from either the compat or even the native LP64 ABI. We would want to reuse some of the code path that are used as the size of the timespec is the same, so this patch exports poll_select_copy_remaining from fs/select.c and renames the copy in fs/compat.c to make sure that it is not being used.
Signed-off-by: Andrew Pinski <apinski@cavium.com>
---
fs/compat.c | 8 ++++----
fs/select.c | 4 ++--
2 files changed, 6 insertions(+), 6 deletions(-)
diff --git a/fs/compat.c b/fs/compat.c
index 6af20de..298e3e1 100644
--- a/fs/compat.c
+++ b/fs/compat.c
@@ -1088,7 +1088,7 @@ COMPAT_SYSCALL_DEFINE4(openat, int, dfd, const char __user *, filename, int, fla
#define __COMPAT_NFDBITS (8 * sizeof(compat_ulong_t))
-static int poll_select_copy_remaining(struct timespec *end_time, void __user *p,
+static int compat_poll_select_copy_remaining(struct timespec *end_time, void __user *p,
int timeval, int ret)
{
struct timespec ts;
@@ -1307,7 +1307,7 @@ asmlinkage long compat_sys_select(int n, compat_ulong_t __user *inp,
}
ret = compat_core_sys_select(n, inp, outp, exp, to);
- ret = poll_select_copy_remaining(&end_time, tvp, 1, ret);
+ ret = compat_poll_select_copy_remaining(&end_time, tvp, 1, ret);
return ret;
}
@@ -1362,7 +1362,7 @@ static long do_compat_pselect(int n, compat_ulong_t __user *inp,
}
ret = compat_core_sys_select(n, inp, outp, exp, to);
- ret = poll_select_copy_remaining(&end_time, tsp, 0, ret);
+ ret = compat_poll_select_copy_remaining(&end_time, tsp, 0, ret);
if (ret == -ERESTARTNOHAND) {
/*
@@ -1448,7 +1448,7 @@ asmlinkage long compat_sys_ppoll(struct pollfd __user *ufds,
} else if (sigmask)
sigprocmask(SIG_SETMASK, &sigsaved, NULL);
- ret = poll_select_copy_remaining(&end_time, tsp, 0, ret);
+ ret = compat_poll_select_copy_remaining(&end_time, tsp, 0, ret);
return ret;
}
diff --git a/fs/select.c b/fs/select.c
index 35d4adc7..aef2c10 100644
--- a/fs/select.c
+++ b/fs/select.c
@@ -287,8 +287,8 @@ int poll_select_set_timeout(struct timespec *to, long sec, long nsec)
return 0;
}
-static int poll_select_copy_remaining(struct timespec *end_time, void __user *p,
- int timeval, int ret)
+int poll_select_copy_remaining(struct timespec *end_time, void __user *p,
+ int timeval, int ret)
{
struct timespec rts;
struct timeval rtv;
--
1.7.2.5
^ permalink raw reply related [flat|nested] 6+ messages in thread
* [PATCH 3/5] FS: Export poll_select_copy_remaining and rename poll_select_copy_remaining in compat.c so it does not pick the wrong copy.
[not found] <1378762380-13152-1-git-send-email-apinski@cavium.com>
2013-09-09 21:32 ` [PATCH 3/5] FS: Export poll_select_copy_remaining and rename poll_select_copy_remaining in compat.c so it does not pick the wrong copy Andrew Pinski
@ 2013-09-09 21:32 ` Andrew Pinski
2013-09-09 21:32 ` Andrew Pinski
2 siblings, 0 replies; 6+ messages in thread
From: Andrew Pinski @ 2013-09-09 21:32 UTC (permalink / raw)
To: linux-arm-kernel, linux-kernel, Alexander Viro, linux-fsdevel,
linux-kernel
Cc: linux-fsdevel, Andrew Pinski, Alexander Viro
Hi,
The ILP32 ABI in ARM64 uses a slightly different pselect from either the compat or even the native LP64 ABI. We would want to reuse some of the code path that are used as the size of the timespec is the same, so this patch exports poll_select_copy_remaining from fs/select.c and renames the copy in fs/compat.c to make sure that it is not being used.
Signed-off-by: Andrew Pinski <apinski@cavium.com>
---
fs/compat.c | 8 ++++----
fs/select.c | 4 ++--
2 files changed, 6 insertions(+), 6 deletions(-)
diff --git a/fs/compat.c b/fs/compat.c
index 6af20de..298e3e1 100644
--- a/fs/compat.c
+++ b/fs/compat.c
@@ -1088,7 +1088,7 @@ COMPAT_SYSCALL_DEFINE4(openat, int, dfd, const char __user *, filename, int, fla
#define __COMPAT_NFDBITS (8 * sizeof(compat_ulong_t))
-static int poll_select_copy_remaining(struct timespec *end_time, void __user *p,
+static int compat_poll_select_copy_remaining(struct timespec *end_time, void __user *p,
int timeval, int ret)
{
struct timespec ts;
@@ -1307,7 +1307,7 @@ asmlinkage long compat_sys_select(int n, compat_ulong_t __user *inp,
}
ret = compat_core_sys_select(n, inp, outp, exp, to);
- ret = poll_select_copy_remaining(&end_time, tvp, 1, ret);
+ ret = compat_poll_select_copy_remaining(&end_time, tvp, 1, ret);
return ret;
}
@@ -1362,7 +1362,7 @@ static long do_compat_pselect(int n, compat_ulong_t __user *inp,
}
ret = compat_core_sys_select(n, inp, outp, exp, to);
- ret = poll_select_copy_remaining(&end_time, tsp, 0, ret);
+ ret = compat_poll_select_copy_remaining(&end_time, tsp, 0, ret);
if (ret == -ERESTARTNOHAND) {
/*
@@ -1448,7 +1448,7 @@ asmlinkage long compat_sys_ppoll(struct pollfd __user *ufds,
} else if (sigmask)
sigprocmask(SIG_SETMASK, &sigsaved, NULL);
- ret = poll_select_copy_remaining(&end_time, tsp, 0, ret);
+ ret = compat_poll_select_copy_remaining(&end_time, tsp, 0, ret);
return ret;
}
diff --git a/fs/select.c b/fs/select.c
index 35d4adc7..aef2c10 100644
--- a/fs/select.c
+++ b/fs/select.c
@@ -287,8 +287,8 @@ int poll_select_set_timeout(struct timespec *to, long sec, long nsec)
return 0;
}
-static int poll_select_copy_remaining(struct timespec *end_time, void __user *p,
- int timeval, int ret)
+int poll_select_copy_remaining(struct timespec *end_time, void __user *p,
+ int timeval, int ret)
{
struct timespec rts;
struct timeval rtv;
--
1.7.2.5
^ permalink raw reply related [flat|nested] 6+ messages in thread
* [PATCH 3/5] FS: Export poll_select_copy_remaining and rename poll_select_copy_remaining in compat.c so it does not pick the wrong copy.
[not found] <1378762380-13152-1-git-send-email-apinski@cavium.com>
@ 2013-09-09 21:32 ` Andrew Pinski
2013-09-09 21:32 ` Andrew Pinski
2013-09-09 21:32 ` Andrew Pinski
2 siblings, 0 replies; 6+ messages in thread
From: Andrew Pinski @ 2013-09-09 21:32 UTC (permalink / raw)
To: linux-arm-kernel, linux-kernel, Alexander Viro, linux-fsdevel,
linux-kernel
Cc: Andrew Pinski, Alexander Viro, linux-fsdevel
Hi,
The ILP32 ABI in ARM64 uses a slightly different pselect from either the compat or even the native LP64 ABI. We would want to reuse some of the code path that are used as the size of the timespec is the same, so this patch exports poll_select_copy_remaining from fs/select.c and renames the copy in fs/compat.c to make sure that it is not being used.
Signed-off-by: Andrew Pinski <apinski@cavium.com>
---
fs/compat.c | 8 ++++----
fs/select.c | 4 ++--
2 files changed, 6 insertions(+), 6 deletions(-)
diff --git a/fs/compat.c b/fs/compat.c
index 6af20de..298e3e1 100644
--- a/fs/compat.c
+++ b/fs/compat.c
@@ -1088,7 +1088,7 @@ COMPAT_SYSCALL_DEFINE4(openat, int, dfd, const char __user *, filename, int, fla
#define __COMPAT_NFDBITS (8 * sizeof(compat_ulong_t))
-static int poll_select_copy_remaining(struct timespec *end_time, void __user *p,
+static int compat_poll_select_copy_remaining(struct timespec *end_time, void __user *p,
int timeval, int ret)
{
struct timespec ts;
@@ -1307,7 +1307,7 @@ asmlinkage long compat_sys_select(int n, compat_ulong_t __user *inp,
}
ret = compat_core_sys_select(n, inp, outp, exp, to);
- ret = poll_select_copy_remaining(&end_time, tvp, 1, ret);
+ ret = compat_poll_select_copy_remaining(&end_time, tvp, 1, ret);
return ret;
}
@@ -1362,7 +1362,7 @@ static long do_compat_pselect(int n, compat_ulong_t __user *inp,
}
ret = compat_core_sys_select(n, inp, outp, exp, to);
- ret = poll_select_copy_remaining(&end_time, tsp, 0, ret);
+ ret = compat_poll_select_copy_remaining(&end_time, tsp, 0, ret);
if (ret == -ERESTARTNOHAND) {
/*
@@ -1448,7 +1448,7 @@ asmlinkage long compat_sys_ppoll(struct pollfd __user *ufds,
} else if (sigmask)
sigprocmask(SIG_SETMASK, &sigsaved, NULL);
- ret = poll_select_copy_remaining(&end_time, tsp, 0, ret);
+ ret = compat_poll_select_copy_remaining(&end_time, tsp, 0, ret);
return ret;
}
diff --git a/fs/select.c b/fs/select.c
index 35d4adc7..aef2c10 100644
--- a/fs/select.c
+++ b/fs/select.c
@@ -287,8 +287,8 @@ int poll_select_set_timeout(struct timespec *to, long sec, long nsec)
return 0;
}
-static int poll_select_copy_remaining(struct timespec *end_time, void __user *p,
- int timeval, int ret)
+int poll_select_copy_remaining(struct timespec *end_time, void __user *p,
+ int timeval, int ret)
{
struct timespec rts;
struct timeval rtv;
--
1.7.2.5
^ permalink raw reply related [flat|nested] 6+ messages in thread
* Re: [PATCH 3/5] FS: Export poll_select_copy_remaining and rename poll_select_copy_remaining in compat.c so it does not pick the wrong copy.
2013-09-09 21:32 ` Andrew Pinski
@ 2013-09-11 11:09 ` Catalin Marinas
2013-09-11 21:00 ` Andrew Pinski
0 siblings, 1 reply; 6+ messages in thread
From: Catalin Marinas @ 2013-09-11 11:09 UTC (permalink / raw)
To: Andrew Pinski
Cc: linux-fsdevel@vger.kernel.org, Andrew Pinski,
linux-kernel@vger.kernel.org,
linux-arm-kernel@lists.infradead.org, Alexander Viro
On Mon, Sep 09, 2013 at 10:32:57PM +0100, Andrew Pinski wrote:
> The ILP32 ABI in ARM64 uses a slightly different pselect from either
> the compat or even the native LP64 ABI. We would want to reuse some
> of the code path that are used as the size of the timespec is the
> same, so this patch exports poll_select_copy_remaining from
> fs/select.c and renames the copy in fs/compat.c to make sure that it
> is not being used.
>
> Signed-off-by: Andrew Pinski <apinski@cavium.com>
I think this patch has to wait until we review the ILP32 ABI for arm64.
When I looked at this some time ago I thought we can just use the native
arm64 pselect6 and ppoll. Once we agree that's not possible we can push
this patch. On its own it doesn't have much value.
--
Catalin
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH 3/5] FS: Export poll_select_copy_remaining and rename poll_select_copy_remaining in compat.c so it does not pick the wrong copy.
2013-09-11 11:09 ` Catalin Marinas
@ 2013-09-11 21:00 ` Andrew Pinski
2013-09-13 9:53 ` Catalin Marinas
0 siblings, 1 reply; 6+ messages in thread
From: Andrew Pinski @ 2013-09-11 21:00 UTC (permalink / raw)
To: Catalin Marinas
Cc: linux-arm-kernel@lists.infradead.org,
linux-kernel@vger.kernel.org, Alexander Viro,
linux-fsdevel@vger.kernel.org, Andrew Pinski
On Wed, Sep 11, 2013 at 4:09 AM, Catalin Marinas
<catalin.marinas@arm.com> wrote:
> On Mon, Sep 09, 2013 at 10:32:57PM +0100, Andrew Pinski wrote:
>> The ILP32 ABI in ARM64 uses a slightly different pselect from either
>> the compat or even the native LP64 ABI. We would want to reuse some
>> of the code path that are used as the size of the timespec is the
>> same, so this patch exports poll_select_copy_remaining from
>> fs/select.c and renames the copy in fs/compat.c to make sure that it
>> is not being used.
>>
>> Signed-off-by: Andrew Pinski <apinski@cavium.com>
>
> I think this patch has to wait until we review the ILP32 ABI for arm64.
> When I looked at this some time ago I thought we can just use the native
> arm64 pselect6 and ppoll. Once we agree that's not possible we can push
> this patch. On its own it doesn't have much value.
Since fd_set is defined by XPG4.2 to be a struct of an array of
"long"'s, we cannot change the definition in user space.
I tried using the native ppoll/pselect for the ABI first. It worked
for little-endian just fine but failed hard when big-endian.
If we only care about little-endian arm64 at this point, I can remove
this part of the patch and keep it for when we (Cavium) submits the
big-endian patches.
Thanks,
Andrew Pinski
>
> --
> Catalin
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH 3/5] FS: Export poll_select_copy_remaining and rename poll_select_copy_remaining in compat.c so it does not pick the wrong copy.
2013-09-11 21:00 ` Andrew Pinski
@ 2013-09-13 9:53 ` Catalin Marinas
0 siblings, 0 replies; 6+ messages in thread
From: Catalin Marinas @ 2013-09-13 9:53 UTC (permalink / raw)
To: Andrew Pinski
Cc: linux-fsdevel@vger.kernel.org, Andrew Pinski,
linux-kernel@vger.kernel.org,
linux-arm-kernel@lists.infradead.org, Alexander Viro
On Wed, Sep 11, 2013 at 10:00:14PM +0100, Andrew Pinski wrote:
> On Wed, Sep 11, 2013 at 4:09 AM, Catalin Marinas
> <catalin.marinas@arm.com> wrote:
> > On Mon, Sep 09, 2013 at 10:32:57PM +0100, Andrew Pinski wrote:
> >> The ILP32 ABI in ARM64 uses a slightly different pselect from either
> >> the compat or even the native LP64 ABI. We would want to reuse some
> >> of the code path that are used as the size of the timespec is the
> >> same, so this patch exports poll_select_copy_remaining from
> >> fs/select.c and renames the copy in fs/compat.c to make sure that it
> >> is not being used.
> >>
> >> Signed-off-by: Andrew Pinski <apinski@cavium.com>
> >
> > I think this patch has to wait until we review the ILP32 ABI for arm64.
> > When I looked at this some time ago I thought we can just use the native
> > arm64 pselect6 and ppoll. Once we agree that's not possible we can push
> > this patch. On its own it doesn't have much value.
>
> Since fd_set is defined by XPG4.2 to be a struct of an array of
> "long"'s, we cannot change the definition in user space.
>
> I tried using the native ppoll/pselect for the ABI first. It worked
> for little-endian just fine but failed hard when big-endian.
> If we only care about little-endian arm64 at this point, I can remove
> this part of the patch and keep it for when we (Cavium) submits the
> big-endian patches.
I see the issue now. I think for the initial set of patches we can
assume little endian. We need a lot more testing, at least for AArch32
mode (we can kick off some tests here once these patches get closer to
merging).
--
Catalin
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2013-09-13 9:53 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
[not found] <1378762380-13152-1-git-send-email-apinski@cavium.com>
2013-09-09 21:32 ` [PATCH 3/5] FS: Export poll_select_copy_remaining and rename poll_select_copy_remaining in compat.c so it does not pick the wrong copy Andrew Pinski
2013-09-09 21:32 ` Andrew Pinski
2013-09-09 21:32 ` Andrew Pinski
2013-09-11 11:09 ` Catalin Marinas
2013-09-11 21:00 ` Andrew Pinski
2013-09-13 9:53 ` Catalin Marinas
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).