Path: csiph.com!eternal-september.org!feeder.eternal-september.org!news.unit0.net!news.panservice.it!bofh.it!news.nic.it!robomod From: Thomas Gleixner Newsgroups: linux.kernel Subject: RE: [PATCH 2/2] x86/vdso: Add VCLOCK_HVCLOCK vDSO clock read method Date: Fri, 10 Feb 2017 19:30:01 +0100 Message-ID: References: User-Agent: Alpine 2.20 (DEB 67 2015-01-07) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Sender: robomod@news.nic.it List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Approved: robomod@news.nic.it Lines: 39 Organization: linux.* mail to news gateway X-Original-Cc: Vitaly Kuznetsov , "x86@kernel.org" , Andy Lutomirski , Ingo Molnar , "H. Peter Anvin" , KY Srinivasan , Haiyang Zhang , Dexuan Cui , "linux-kernel@vger.kernel.org" , "devel@linuxdriverproject.org" , "virtualization@lists.linux-foundation.org" X-Original-Date: Fri, 10 Feb 2017 19:01:52 +0100 (CET) X-Original-Message-ID: X-Original-References: <20170209141052.18694-1-vkuznets@redhat.com> <20170209141052.18694-3-vkuznets@redhat.com> <87d1eqqlkv.fsf@vitty.brq.redhat.com> X-Original-Sender: linux-kernel-owner@vger.kernel.org Xref: csiph.com linux.kernel:1578687 On Fri, 10 Feb 2017, Stephen Hemminger wrote: > Since sequence count algorithm is done by hypervisor, better to not reuse seqcount. > Still concerned that the code is racy. That's a different question and can only be answered by the hypervisor folks. Dunno, whether they have barrier requirements. The seqcount stuff relies on: do { seq = READ_ONCE(s->sequence); smp_rmb(); sample_data(); smp_rmb(); } while (s->sequence != seq); which pairs with the writer side: s->sequence++; smp_wmb(); update_data(); smp_wmb(); s->sequence++; That's important if the stuff happens cross CPU. If the update happens on the same CPU then this is a different story and as there are VMexits involved they might provide the required ordering already. But I can't tell as I have no idea how that host side thing is done. Thanks, tglx