linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
From: Andrew Donnellan <ajd@linux.ibm.com>
To: Rohan McLure <rmclure@linux.ibm.com>, linuxppc-dev@lists.ozlabs.org
Cc: npiggin@gmail.com
Subject: Re: [PATCH v2 08/14] powerpc: Use common syscall handler type
Date: Mon, 08 Aug 2022 17:35:23 +1000	[thread overview]
Message-ID: <172c6e205c4f1ee36900b7ba3753847983242f6c.camel@linux.ibm.com> (raw)
In-Reply-To: <20220725062845.119908-1-rmclure@linux.ibm.com>

On Mon, 2022-07-25 at 16:28 +1000, Rohan McLure wrote:
> Cause syscall handlers to be typed as follows when called indirectly
> throughout the kernel.
> 
> typedef long (*syscall_fn)(unsigned long, unsigned long, unsigned
> long,
>                            unsigned long, unsigned long, unsigned
> long);
> 
> Since both 32 and 64-bit abis allow for at least the first six
> machine-word length parameters to a function to be passed by
> registers,
> even handlers which admit fewer than six parameters may be viewed as
> having the above type.
> 
> Fixup comparisons in VDSO to avoid pointer-integer comparison.
> Introduce
> explicit cast on systems with SPUs.
> 
> Signed-off-by: Rohan McLure <rmclure@linux.ibm.com>

This patch needs rebasing on top of commit 1547db7d1f44 ("powerpc: Move
system_call_exception() to syscall.c").

> 
> diff --git a/arch/powerpc/platforms/cell/spu_callbacks.c
> b/arch/powerpc/platforms/cell/spu_callbacks.c
> index fe0d8797a00a..114bbe2eeacc 100644
> --- a/arch/powerpc/platforms/cell/spu_callbacks.c
> +++ b/arch/powerpc/platforms/cell/spu_callbacks.c
> @@ -34,22 +34,22 @@
>   *     mbind, mq_open, ipc, ...
>   */
>  
> -static void *spu_syscall_table[] = {
> +static const syscall_fn spu_syscall_table[] = {
>  #define __SYSCALL_WITH_COMPAT(nr, entry, compat) __SYSCALL(nr,
> entry)
> -#define __SYSCALL(nr, entry) [nr] = entry,
> +#define __SYSCALL(nr, entry) [nr] = (void *) entry,
>  #include <asm/syscall_table_spu.h>
>  };
>  
>  long spu_sys_callback(struct spu_syscall_block *s)
>  {
> -       long (*syscall)(u64 a1, u64 a2, u64 a3, u64 a4, u64 a5, u64
> a6);
> +       syscall_fn syscall;
>  
>         if (s->nr_ret >= ARRAY_SIZE(spu_syscall_table)) {
>                 pr_debug("%s: invalid syscall #%lld", __func__, s-
> >nr_ret);
>                 return -ENOSYS;
>         }
>  
> -       syscall = spu_syscall_table[s->nr_ret];
> +       syscall = (syscall_fn) spu_syscall_table[s->nr_ret];

I don't think this cast is necessary?

>  
>         pr_debug("SPU-syscall "
>                  "%pSR:syscall%lld(%llx, %llx, %llx, %llx, %llx,
> %llx)\n",

-- 
Andrew Donnellan    OzLabs, ADL Canberra
ajd@linux.ibm.com   IBM Australia Limited


      reply	other threads:[~2022-08-08  7:36 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-07-25  6:28 [PATCH v2 08/14] powerpc: Use common syscall handler type Rohan McLure
2022-08-08  7:35 ` Andrew Donnellan [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=172c6e205c4f1ee36900b7ba3753847983242f6c.camel@linux.ibm.com \
    --to=ajd@linux.ibm.com \
    --cc=linuxppc-dev@lists.ozlabs.org \
    --cc=npiggin@gmail.com \
    --cc=rmclure@linux.ibm.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).