public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: "Petr Vandrovec" <VANDROVE@vc.cvut.cz>
To: "Richard B. Johnson" <root@chaos.analogic.com>
Cc: linux-kernel@vger.kernel.org
Subject: Re: gnu asm help...
Date: Tue, 19 Jun 2001 20:02:29 MET-1	[thread overview]
Message-ID: <6484B6B2F3A@vcnet.vc.cvut.cz> (raw)

On 19 Jun 01 at 13:21, Richard B. Johnson wrote:
> On Tue, 19 Jun 2001, Timur Tabi wrote:
> > Oh, I see the problem.  You could do something like this:
> > 
> > cli
> > mov %0, %%eax
> > inc %%eax
> > mov %%eax, %0
> > sti
> > 
> > and then return eax, but that won't work on SMP (whereas the "lock inc" does).
> > Doing a global cli might work, though.

Use spinlocks instead of global cli. Global cli can take milliseconds.
 
> The Intel book(s) state that an interrupt is not acknowledged until
> so many clocks (don't remember the number) after a stack operation.

Reread it. It says 'after operation with ss' - that is after
"mov xxxx,%ss" or "pop %ss", as it is expected that next instruction 
will be "movl yyyy,%esp". 

Before "lss ...." (it is lss in intel mnemonic...) was invented, you 
could not switch your stack safely without this feature, as NMI could 
arrive in the middle of your stack switch without blocking all interrupts 
after "mov xxxx,%ss". 

BTW, if you chain "mov %eax,%ss" back to back, they are executed
in pairs - irq can arrive after even mov, but cannot after odd (at
least on PII and PIII). But it is a bit off topic for L-K (except that 
we can try other clones, maybe someone got it wrong?)
                                        Best regards,
                                            Petr Vandrovec
                                            vandrove@vc.cvut.cz
                                            
                                                

             reply	other threads:[~2001-06-19 18:03 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2001-06-19 20:02 Petr Vandrovec [this message]
  -- strict thread matches above, loose matches on Subject: below --
2001-06-19  3:06 gnu asm help Rick Hohensee
2001-06-19  1:36 Petr Vandrovec
2001-06-19 15:48 ` Timur Tabi
2001-06-19 17:21   ` Richard B. Johnson
2001-06-18 22:56 Raj, Ashok
2001-06-18 23:18 ` Erik Mouw
2001-06-19  6:25   ` Bohdan Vlasyuk
2001-06-18 23:20 ` Timur Tabi
2001-06-19  7:44 ` Alan Cox

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=6484B6B2F3A@vcnet.vc.cvut.cz \
    --to=vandrove@vc.cvut.cz \
    --cc=linux-kernel@vger.kernel.org \
    --cc=root@chaos.analogic.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