linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
From: Milton Miller <miltonm@bga.com>
To: Stephen Rothwell <sfr@canb.auug.org.au>
Cc: ppcdev <linuxppc-dev@ozlabs.org>
Subject: Re: [PATCH] [POWERPC] Check that the syscall table matches the syscall
Date: Thu, 3 Jan 2008 01:32:21 -0600	[thread overview]
Message-ID: <cc783558d0d687131f756488692cc34b@bga.com> (raw)

Hmmm, in-reply-to on the web archive is broken again, sfr alerted.

On Thu Jan 3 16:41:41 EST 2008, Stephen Rothwell wrote:

> Hopefully this will catch any out of order additions to the
> table in the future.

>  #ifdef CONFIG_PPC64
> -#define SYSCALL(func)          .llong  .sys_##func,.sys_##func
> -#define COMPAT_SYS(func)       .llong  .sys_##func,.compat_sys_##func
> -#define PPC_SYS(func)          .llong  .ppc_##func,.ppc_##func
> +#define CHECK_SYS(n)           .org .sys_call_table + n * 16
> +
> +#define SYSCALL(func)          CHECK_SYS(__NR_##func); \
> +                               .llong  .sys_##func,.sys_##func
> +#define COMPAT_SYS(func)       CHECK_SYS(__NR_##func); \
> +                               .llong  .sys_##func,.compat_sys_##func
>

While it may detect misordered additions, it does nothing to check for 
holes.   Actually, it would hide holes:  presently, if you leave a hole 
the entry you add at the end of the table will not work / crash the 
kernel.  After this patch, the hole will crash the kernel but the new 
syscall will work.

I'm still thinking this through, but perhaps instead of checking the 
numbers by org in asm, we can define another way to include the 
systable.h, possibly as a build-only check target.

Something compareing the line number to __NR_##func perhaps cpp into a 
simple awk script ...

later,
milton

             reply	other threads:[~2008-01-03  7:32 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-01-03  7:32 Milton Miller [this message]
2008-01-03 10:07 ` Test (Was: Re: [PATCH] [POWERPC] Check that the syscall table matches the syscall ) Stephen Rothwell

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=cc783558d0d687131f756488692cc34b@bga.com \
    --to=miltonm@bga.com \
    --cc=linuxppc-dev@ozlabs.org \
    --cc=sfr@canb.auug.org.au \
    /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).