From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753414AbcAGVsA (ORCPT ); Thu, 7 Jan 2016 16:48:00 -0500 Received: from mail-wm0-f46.google.com ([74.125.82.46]:38655 "EHLO mail-wm0-f46.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752552AbcAGVr4 (ORCPT ); Thu, 7 Jan 2016 16:47:56 -0500 Subject: Re: [PATCH] x86/vdso/pvclock: Protect STABLE check with the seqcount To: Andy Lutomirski , Marcelo Tosatti References: <20160104225904.GA4947@amt.cnet> <755dcedb17269e1d7ce12a9a713dea303835137e.1451949191.git.luto@kernel.org> <20160107210216.GA19334@amt.cnet> Cc: Andy Lutomirski , X86 ML , Radim Krcmar , "linux-kernel@vger.kernel.org" , kvm list , Alexander Graf From: Paolo Bonzini Message-ID: <568EDD03.6020508@redhat.com> Date: Thu, 7 Jan 2016 22:47:47 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.4.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 Paolo