* Re: [PATCH] sys_vmsplice
[not found] ` <20060421022555.2d460805.akpm@osdl.org>
@ 2006-04-21 10:41 ` Arnd Bergmann
2006-04-21 10:45 ` [PATCH] fix spu_callbacks BUILD_BUG_ON Arnd Bergmann
0 siblings, 1 reply; 4+ messages in thread
From: Arnd Bergmann @ 2006-04-21 10:41 UTC (permalink / raw)
To: Andrew Morton
Cc: linux-kernel, Jens Axboe, linuxppc-dev, torvalds, Paul Mackerras,
davem
On Friday 21 April 2006 11:25, Andrew Morton wrote:
> It might be better to just stick the new entry into the spufs table, make
> sure that the powerpc guys see it go in. That way, ppc64 people (Linus,
> maybe you?) can test it.
>
> I guess mapping it onto sys_ni_syscall would be safest.
>
> (It's been broken since sys_tee went in, btw).
The BUILD_BUG_ON in there was just overkill. How about if we just add a
small comment to the systbl on powerpc to remind people about the fact
that there is another file to edit? Patch follows.
Arnd <><
^ permalink raw reply [flat|nested] 4+ messages in thread
* [PATCH] fix spu_callbacks BUILD_BUG_ON
2006-04-21 10:41 ` [PATCH] sys_vmsplice Arnd Bergmann
@ 2006-04-21 10:45 ` Arnd Bergmann
2006-04-21 13:14 ` Jan Engelhardt
0 siblings, 1 reply; 4+ messages in thread
From: Arnd Bergmann @ 2006-04-21 10:45 UTC (permalink / raw)
To: Andrew Morton
Cc: linux-kernel, Jens Axboe, linuxppc-dev, torvalds, Paul Mackerras,
davem
Every time a new syscall gets added, a BUILD_BUG_ON in
arch/powerpc/platforms/cell/spu_callbacks.c gets triggered.
Since the addition of a new syscall is rather harmless,
the error should just be removed.
While we're here, add sys_tee to the list and add a comment
to systbl.S to remind people that there is another list
on powerpc.
Signed-of-by: Arnd Bergmann <arnd.bergmann@de•ibm.com>
--- linus-2.6.orig/arch/powerpc/platforms/cell/spu_callbacks.c
+++ linus-2.6/arch/powerpc/platforms/cell/spu_callbacks.c
@@ -317,17 +317,16 @@ void *spu_syscall_table[] = {
[__NR_ppoll] sys_ni_syscall, /* sys_ppoll */
[__NR_unshare] sys_unshare,
[__NR_splice] sys_splice,
+ [__NR_tee] sys_tee,
};
long spu_sys_callback(struct spu_syscall_block *s)
{
long (*syscall)(u64 a1, u64 a2, u64 a3, u64 a4, u64 a5, u64 a6);
- BUILD_BUG_ON(ARRAY_SIZE(spu_syscall_table) != __NR_syscalls);
-
syscall = spu_syscall_table[s->nr_ret];
- if (s->nr_ret >= __NR_syscalls) {
+ if (s->nr_ret >= ARRAY_SIZE(spu_syscall_table)) {
pr_debug("%s: invalid syscall #%ld", __FUNCTION__, s->nr_ret);
return -ENOSYS;
}
Index: linus-2.6/arch/powerpc/kernel/systbl.S
===================================================================
--- linus-2.6.orig/arch/powerpc/kernel/systbl.S
+++ linus-2.6/arch/powerpc/kernel/systbl.S
@@ -324,3 +324,8 @@ COMPAT_SYS(ppoll)
SYSCALL(unshare)
SYSCALL(splice)
SYSCALL(tee)
+
+/*
+ * please add new calls to arch/powerpc/platforms/cell/spu_callbacks.c
+ * as well when appropriate.
+ */
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] fix spu_callbacks BUILD_BUG_ON
2006-04-21 10:45 ` [PATCH] fix spu_callbacks BUILD_BUG_ON Arnd Bergmann
@ 2006-04-21 13:14 ` Jan Engelhardt
2006-04-21 13:52 ` Arnd Bergmann
0 siblings, 1 reply; 4+ messages in thread
From: Jan Engelhardt @ 2006-04-21 13:14 UTC (permalink / raw)
To: Arnd Bergmann
Cc: Andrew Morton, linux-kernel, Jens Axboe, linuxppc-dev, torvalds,
Paul Mackerras, davem
>--- linus-2.6.orig/arch/powerpc/platforms/cell/spu_callbacks.c
>+++ linus-2.6/arch/powerpc/platforms/cell/spu_callbacks.c
>@@ -317,17 +317,16 @@ void *spu_syscall_table[] = {
> [__NR_ppoll] sys_ni_syscall, /* sys_ppoll */
> [__NR_unshare] sys_unshare,
> [__NR_splice] sys_splice,
>+ [__NR_tee] sys_tee,
+ [__NR_syscalls] = NULL,
> };
>
> long spu_sys_callback(struct spu_syscall_block *s)
> {
> long (*syscall)(u64 a1, u64 a2, u64 a3, u64 a4, u64 a5, u64 a6);
>
>- BUILD_BUG_ON(ARRAY_SIZE(spu_syscall_table) != __NR_syscalls);
>-
> syscall = spu_syscall_table[s->nr_ret];
>
>- if (s->nr_ret >= __NR_syscalls) {
>+ if (s->nr_ret >= ARRAY_SIZE(spu_syscall_table)) {
+ if(syscall == NULL) {
That way, syscalls could be added in the master table while spu does not
break. Comments?
Jan Engelhardt
--
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] fix spu_callbacks BUILD_BUG_ON
2006-04-21 13:14 ` Jan Engelhardt
@ 2006-04-21 13:52 ` Arnd Bergmann
0 siblings, 0 replies; 4+ messages in thread
From: Arnd Bergmann @ 2006-04-21 13:52 UTC (permalink / raw)
To: Jan Engelhardt
Cc: Andrew Morton, linux-kernel, Jens Axboe, linuxppc-dev, torvalds,
Paul Mackerras, davem
On Friday 21 April 2006 15:14, Jan Engelhardt wrote:
> + [__NR_syscalls] = NULL,
>
> > };
> >
> >- if (s->nr_ret >= __NR_syscalls) {
> >+ if (s->nr_ret >= ARRAY_SIZE(spu_syscall_table)) {
>
> + if(syscall == NULL) {
>
>
>
> That way, syscalls could be added in the master table while spu does not
> break. Comments?
Hmm, my idea was not having to check for NULL pointers when we know
that they are valid function calls. But you are right that your approach
is more robust. It also means that we might just leave out all
the assignments to sys_ni_syscall in order to make the source a little
shorter.
Arnd <><
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2006-04-21 13:52 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
[not found] <20060421080239.GC4717@suse.de>
[not found] ` <20060421092158.GE4717@suse.de>
[not found] ` <20060421022555.2d460805.akpm@osdl.org>
2006-04-21 10:41 ` [PATCH] sys_vmsplice Arnd Bergmann
2006-04-21 10:45 ` [PATCH] fix spu_callbacks BUILD_BUG_ON Arnd Bergmann
2006-04-21 13:14 ` Jan Engelhardt
2006-04-21 13:52 ` Arnd Bergmann
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox