mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Andrea Arcangeli <andrea@novell.com>
To: Linus Torvalds <torvalds@osdl.org>
Cc: Kernel Mailing List <linux-kernel@vger.kernel.org>
Subject: Re: RFC: avoid asmlinkage on x86 traps/interrupts
Date: Wed, 3 Nov 2004 10:07:10 +0100	[thread overview]
Message-ID: <20041103090710.GV3571@dualathlon.random> (raw)
In-Reply-To: <Pine.LNX.4.58.0411021250310.2187@ppc970.osdl.org>

On Tue, Nov 02, 2004 at 12:56:54PM -0800, Linus Torvalds wrote:
>  	if (curctx != irqctx) {
> +		int arg1, arg2, ebx;
> +
>  		/* build the stack frame on the IRQ stack */
>  		isp = (u32*) ((char*)irqctx + sizeof(*irqctx));
>  		irqctx->tinfo.task = curctx->tinfo.task;
>  		irqctx->tinfo.previous_esp = current_stack_pointer();
>  
> -		*--isp = (u32) &regs;
> -		*--isp = (u32) irq;
> -
>  		asm volatile(
>  			"       xchgl   %%ebx,%%esp      \n"
>  			"       call    __do_IRQ         \n"
> -			"       xchgl   %%ebx,%%esp      \n"
> -			: : "b"(isp)
> -			: "memory", "cc", "eax", "edx", "ecx"
> +			"       movl   %%ebx,%%esp      \n"
> +			: "=a" (arg1), "=d" (arg2), "=b" (ebx)
> +			:  "0" (irq),   "1" (regs),  "2" (isp)
> +			: "memory", "cc", "ecx"
>  		);

why do you restore the parameters into arg1/arg2/ebx? since it's
volatile I doubt gcc can optimize them away despite they're clearly
going to be discarded.

I guess it'd be nicer to simply move the output into the input with "a",
"d", "b", and the not add any output at all, and put "eax/edx" back into
the clobbers.

  reply	other threads:[~2004-11-03  9:42 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-11-02 20:56 Linus Torvalds
2004-11-03  9:07 ` Andrea Arcangeli [this message]
2004-11-03 15:19   ` Linus Torvalds
2004-11-04  2:08     ` Andrea Arcangeli
2004-11-04  3:40       ` Linus Torvalds

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=20041103090710.GV3571@dualathlon.random \
    --to=andrea@novell.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=torvalds@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®