mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Linus Torvalds <torvalds@osdl.org>
To: "Randy.Dunlap" <rddunlap@osdl.org>
Cc: Brian Gerst <bgerst@quark.didntduck.org>,
	lkml <linux-kernel@vger.kernel.org>,
	Andrew Morton <akpm@osdl.org>
Subject: Re: [PATCH] Regparm for x86 machine check handlers
Date: Mon, 15 Nov 2004 15:10:52 -0800 (PST)	[thread overview]
Message-ID: <Pine.LNX.4.58.0411151501080.2222@ppc970.osdl.org> (raw)
In-Reply-To: <41992590.4060004@osdl.org>



On Mon, 15 Nov 2004, Randy.Dunlap wrote:
> 
> and omit "asmlinkage.*sys_xyz".  that leaves a handful of functions
> which are <asm>, like:
> 
> acpi_status asmlinkage acpi_enter_sleep_state(u8 sleep_state);
> csum_partial(), csum_partial_copy_generic(),
> schedule_tail(), aes_enc_blk(), aes_dec_blk().

The schedule_tail() usage seems a bit suspect. The asm code on x86 seems 
to play it safe, and pass the argument _both_ on the stack and in 
registers. So it looks correct, but a bit schitzo.

The others should probably be changed to use register calling conventions,
but it might not be worth doing so right now, and at least they seem to
agree on how to pass arguments in callers and callee's. The csum functions
are certainly performance-critical, but it's not like the argument passing 
convention is likely to make _that_ big of a difference, and they are 
"asmcall" not because they are called from asm, but because they are 
_implemented_ in asm (so unlike the other cases, these guys don't have
the problem with the callee thinking it owns the argument frame).

> I don't see others than need to be fixed, but a script
> would be a safer way to check, so I'm trying to nail down
> the requirements ... and what tool to use, like is there
> already a PERL [or python or xyz] script that parses C,
> or would you *coff* recommend sparse?

Sparse can't look into the asm code, but it could certainly be made to 
report on functions that use "regparm(0)". But it would be good to have 
something that matches up the functions with the asm code and verifies 
that they agree on passing convention.

There doesn't seem to be enough of them to bother with a tool, though.

		Linus

      reply	other threads:[~2004-11-15 23:12 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-11-15 17:42 Brian Gerst
2004-11-15 20:05 ` Linus Torvalds
2004-11-15 21:54   ` Randy.Dunlap
2004-11-15 23:10     ` Linus Torvalds [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=Pine.LNX.4.58.0411151501080.2222@ppc970.osdl.org \
    --to=torvalds@osdl.org \
    --cc=akpm@osdl.org \
    --cc=bgerst@quark.didntduck.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=rddunlap@osdl.org \
    /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

all inboxes | Powered by JetHome®