linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
From: Paul Mackerras <paulus@samba.org>
To: Ronald Wahl <rwa@peppercon.com>
Cc: linuxppc-dev@lists.linuxppc.org
Subject: Re: twi/isync/nop sequence in newer ppc linux kernels
Date: Fri, 9 Jan 2004 10:42:56 +1100	[thread overview]
Message-ID: <16381.60160.345637.268859@cargo.ozlabs.ibm.com> (raw)
In-Reply-To: <m37k02o0n6.fsf@gandalf.peppercon.de>


Ronald Wahl writes:

> I'm programming an embedded device (with PPC405GP/EP) that has to access the
> pci bus and there may be cases that there is no one listening there and a
> timeout occurs which results in a machine check. Until now I used a eieio
> operation with an exception handler after the actual io operation and this
> seems to work. Current kernels contain a twi/isync/nop sequence. What are
> the reasons for this sequence instead of an eieio? Is it only needed on
> some processors? Is there a document that describes this special
> sequence in more detail?

The sequence was determined experimentally.  The 601 was the worst in
terms of containing where the machine check would happen after a bad
access.  The idea is that the twi is intended to create a dependency
on the value read, such that the processor doesn't know if the
instruction will generate an exception until the data comes back (in
fact the particular form of the twi instruction that I use won't ever
generate an exception, but fortunately the 601 isn't smart enough to
recognize that).  The isync is then meant to stop the cpu until all
previous instructions have been executed to the point where the cpu
knows whether they will generate an exception or not.  The nop is
there because the machine check can still occur on the instruction
after the isync on 601 (IIRC).

As I recall, the 604 was better but still needed more than just an
eieio or sync, and the G3 and G4 just needed an eieio or sync.

Paul.

** Sent via the linuxppc-dev mail list. See http://lists.linuxppc.org/

      reply	other threads:[~2004-01-08 23:42 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-01-08 16:39 twi/isync/nop sequence in newer ppc linux kernels Ronald Wahl
2004-01-08 23:42 ` Paul Mackerras [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=16381.60160.345637.268859@cargo.ozlabs.ibm.com \
    --to=paulus@samba.org \
    --cc=linuxppc-dev@lists.linuxppc.org \
    --cc=rwa@peppercon.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).