Subject: Re: USB stack needs early review (Re: Someone should fix our USB stack...)
To: None <tech-kern@NetBSD.org>
From: Joerg Sonnenberger <joerg@britannica.bec.de>
List: tech-kern
Date: 05/01/2007 17:34:57
On Sat, Apr 28, 2007 at 11:07:06AM -0400, der Mouse wrote:
> > ... noting that the bottom half which can write to sc->flags is
> > blocked out while it is being examined.
> 
> Still doesn't help if the data being examined is file-static and does
> not have its address stored anywhere global and thus is not modifiable
> by tsleep() according to the C virtual machine; the compiler is then
> perfectly within its rights to keep the flags word in a register across
> the tsleep().

A simple graph argument defeats this. If there is any active code path
that modifies the storage location, it needs to be callable from the
outside (otherwise it isn't active). The compiler can't interfere that
tsleep is not able to take this code path.

Joerg