linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
From: Benjamin Herrenschmidt <benh@kernel.crashing.org>
To: Josh Boyer <jwboyer@linux.vnet.ibm.com>
Cc: linuxppc-dev@ozlabs.org, Hollis Blanchard <hollisb@us.ibm.com>
Subject: Re: Fix small race in 44x tlbie function
Date: Thu, 09 Aug 2007 09:01:29 +1000	[thread overview]
Message-ID: <1186614089.938.207.camel@localhost.localdomain> (raw)
In-Reply-To: <20070808162951.46491bc7@weaponx.rchland.ibm.com>

On Wed, 2007-08-08 at 16:29 -0500, Josh Boyer wrote:
> On Wed, 8 Aug 2007 20:43:25 +0000 (UTC)
> Hollis Blanchard <hollisb@us.ibm.com> wrote:
> 
> > On Tue, 07 Aug 2007 14:20:50 +1000, David Gibson wrote:
> > > 
> > > This patch fixes the problem in both arch/ppc and arch/powerpc by
> > > inhibiting interrupts (even critical and debug interrupts) across the
> > > relevant instructions.
> > 
> > How could a critical or debug interrupt modify the contents of MMUCR?
> 
> Interrupts from UICs can be configured as critical.  If one of those
> triggers, (or any other CE triggers) and causes a tlb miss, you have a
> race.  The watchdog timer interrupt also is a CE IIRC.
> 
> CE and DE are admittedly a much smaller race, but still possible.
> Masking EE off is the largest one.

There is a much bigger problem if CEs can do tlb misses though... they
can interrupt the tlb miss handler itself, either between the two halves
of a tlb write, or between the write to MMUCR and the write to the tlb,
and I suspect both cases will cause trouble.

We might want to check if we were in the TLB miss handler upon return
from the CE and MCE handlers, and in this case, restart them (just
return to the faulting instruction, that is use srr0 instead of
csrr0/mcsrr0).

Ben.

  parent reply	other threads:[~2007-08-08 23:01 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-08-07  4:20 Fix small race in 44x tlbie function David Gibson
2007-08-08 14:49 ` Josh Boyer
2007-08-08 15:20 ` Kumar Gala
2007-08-08 16:00   ` Josh Boyer
2007-08-09  5:28     ` Kumar Gala
2007-08-09  5:34       ` David Gibson
2007-08-09  6:35         ` Kumar Gala
2007-08-09  7:01           ` Benjamin Herrenschmidt
2007-08-09 12:04       ` Josh Boyer
2007-08-09 13:05         ` Benjamin Herrenschmidt
2007-08-09 13:26           ` Josh Boyer
2007-08-08 20:43 ` Hollis Blanchard
2007-08-08 21:29   ` Josh Boyer
2007-08-08 22:11     ` Hollis Blanchard
2007-08-08 23:30       ` Benjamin Herrenschmidt
2007-08-08 23:41       ` Josh Boyer
2007-08-08 23:01     ` Benjamin Herrenschmidt [this message]
2007-08-09  0:06       ` Josh Boyer
  -- strict thread matches above, loose matches on Subject: below --
2007-08-08 15:34 Volkmar Uhlig

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=1186614089.938.207.camel@localhost.localdomain \
    --to=benh@kernel.crashing.org \
    --cc=hollisb@us.ibm.com \
    --cc=jwboyer@linux.vnet.ibm.com \
    --cc=linuxppc-dev@ozlabs.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;
as well as URLs for NNTP newsgroup(s).