Subject: Re: fsl booke MM vs. SMP questions

From: Gabriel Paubert <[email-masked]>
Date: Tue, 22 May 2007 12:02:12 +0200

On Tue, May 22, 2007 at 07:14:38PM +1000, Benjamin Herrenschmidt wrote:
> > Why do you want to clear the reservation here? 
> > 
> > Coming out of some code path with the reservation still held 
> > can only affect buggy code (someone doing st[dw]cx. before 
> > l[dw]arx) AFAIK.
> 
> And buggy CPUs :-)
> 
> Seriously, lots of CPU implementations don't test the address for local
> lwarx stwcx. so if your kernel code "replaces" a reservation with
> another that is left set, the userland stwcx. might well succeed which
> is bogus.
> 

Well, there should always be an stwcx. to clear reservation before
any interrupt return. Otherwise you'll be able to cause hard to
reproduce bugs in the interrupted code.

Checking or not that the reservation address matches the stwcx.
is irrelevant.

	Gabriel