Re: [PATCH] x86/vdso/pvclock: Protect STABLE check with the seqcount
From: Paolo Bonzini
Date: Thu Jan 07 2016 - 16:48:06 EST
On 07/01/2016 22:13, Andy Lutomirski wrote:
> I don't understand what you mean.
>
> In the old code (4.3 and 4.4), the vdso checks STABLE_BIT at the end,
> which is correct as long as STABLE_BIT can never change from 0 to 1.
>
> In the -tip code, it's clearly wrong.
>
> In the code in this patch, it should be correct regardless of how
> STABLE_BIT changes as long as the seqcount works. Given that the
> performance cost of doing that is zero, I'd rather keep it that way.
> If we're really paranoid, we could move it after the rest of the pvti
> reads and add a barrier, but is there really any host on which that
> matters?
I agree that your patch is fine.
Reviewed-by: Paolo Bonzini <pbonzini@xxxxxxxxxx>
Paolo