From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751507AbcFIMbX (ORCPT ); Thu, 9 Jun 2016 08:31:23 -0400 Received: from mx1.redhat.com ([209.132.183.28]:59003 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751286AbcFIMbV (ORCPT ); Thu, 9 Jun 2016 08:31:21 -0400 Subject: Re: [PATCH 3/3 V2] pvclock: Get rid of __pvclock_read_cycles in function pvclock_read_flags To: Borislav Petkov References: <1464329832-4638-3-git-send-email-mnghuan@gmail.com> <1464438463-8485-1-git-send-email-mnghuan@gmail.com> <20160608081739.GD26187@pd.tnic> <1ade9d3e-2064-c811-f718-371d91c7874c@redhat.com> <20160609112807.GB12860@pd.tnic> Cc: Minfei Huang , luto@kernel.org, hpa@zytor.com, mingo@redhat.com, tglx@linutronix.de, x86@kernel.org, linux-kernel@vger.kernel.org From: Paolo Bonzini Message-ID: <17556f35-2c69-4793-27bf-3280f0177122@redhat.com> Date: Thu, 9 Jun 2016 14:31:15 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.1.0 MIME-Version: 1.0 In-Reply-To: <20160609112807.GB12860@pd.tnic> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.30]); Thu, 09 Jun 2016 12:31:20 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 09/06/2016 13:28, Borislav Petkov wrote: >> > technically, they should be virt_rmb() -- it really doesn't matter of >> > course because reads are never reordered on x86. > You mean > > version = src->version; > flags = src->flags; > > are not reordered? > > I don't think so. The compiler can reorder them, so smp_rmb() and virt_rmb() have to be barrier(), but the processor won't. x86 will only move a store after a subsequent load, if you exclude special cases such as write combining, non-temporal moves and the like. LFENCE and SFENCE are only needed for those special cases. Paolo