Re: [patch 134/149] x86, paravirt: Add a global synchronization point for pvclock

From: H. Peter Anvin
Date: Fri Jul 16 2010 - 00:50:11 EST


On 07/14/2010 01:45 PM, Zachary Amsden wrote:
> That's the kind of bug I think Linus is talking about. We've been
> expecting volatile to work that way for over a decade, by my
> recollection, and if it doesn't, there is going to be a lot of broken code.
>
> Shouldn't we at least get a compiler switch to force the volatile
> behavior? I'd suggest it default to conservative.

At this point, it looks like there is no reason to be alarmed. The
documentation actually contains a statement about volatiles not being
mutually reordered across sequence points, and since asm is a statement
(rather than an expression) it is always surrounded by sequence points.
I have filed a gcc ticket to ask for clarification.

-hpa

--
H. Peter Anvin, Intel Open Source Technology Center
I work for Intel. I don't speak on their behalf.

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/