Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp1160576ybl; Fri, 10 Jan 2020 13:13:21 -0800 (PST) X-Google-Smtp-Source: APXvYqxscgLVZddAlH6KttTuO5A05MdlTRhRiTAInCBtKEr7HKs5MutrwcsKrGJ33aLZ+eQ7zAFc X-Received: by 2002:a9d:70d9:: with SMTP id w25mr4416569otj.231.1578690801130; Fri, 10 Jan 2020 13:13:21 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1578690801; cv=none; d=google.com; s=arc-20160816; b=U9vpphSpmzKAAgVn77Hsx5yCoO1KGWClLgk84Dl0pA881ZcU9ec0MV4RGMBtNyZm+K Mbrwn4972IEzDVJI9rCOXI+MUmL/aBvnxBqO6bDX3QftqdFTvr3X8Eq0eg2sLwq1ZGAG wSyFVZEvJfi8wdoc/9ZECb45w4+/CWbcD7rqAtln24oJUVfbjRRr+0x4Rl9Nv3VmEPqi 8rM5nm5wC21x6tlVtmaJug587EDQBfR5BmIyNoFP4qZx+KiDDtLvZdN34ihCR1AR3swh bvQAjUYF0m8f1f1Y6RGK7IwM3rPO4acf9r2+mDR9ZJ/ccoGwJiVVnZYaDR3vSbLFI0/5 ltlg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:message-id:date:references :in-reply-to:subject:cc:to:from; bh=KK0oKOTSwbsqpFcKAZtaobVFG6dMpsTLv31jj3HBqf8=; b=z3Hys1eNQm+9sjfNLQ1vQZlXhPYvT4BCl2bRG30jbeUxRfiw9PyPKK5mit2NKs+9OB mcIAvtBfpfZANaZXFZELxHOHCr1W1kbD0+PjInGGQzYrcGc6tZPNAQUw5bw34oZQLHWd Pv5IU5zLNICadS6RJPsW1YCNIQZUO9QLKvdANGu/U8hP+HosHXw42k8tRFuFUfsl82qK vVxvWm4Fh1WV+WQFvyygzcjMkHd3pvnRJqxZ8FBJQIyGByfGgsBy7PKBiu+4vDxRoM9r jwt+lW9tALW0hjNT1lea69ur+dGRiknSbgA7M2+Yel5jNrSulFuQFvrSYR9FMPvKba/E mBnw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id p26si2057681oto.240.2020.01.10.13.13.09; Fri, 10 Jan 2020 13:13:21 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726945AbgAJVMQ (ORCPT + 99 others); Fri, 10 Jan 2020 16:12:16 -0500 Received: from Galois.linutronix.de ([193.142.43.55]:59809 "EHLO Galois.linutronix.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726762AbgAJVMQ (ORCPT ); Fri, 10 Jan 2020 16:12:16 -0500 Received: from p5b06da22.dip0.t-ipconnect.de ([91.6.218.34] helo=nanos.tec.linutronix.de) by Galois.linutronix.de with esmtpsa (TLS1.2:DHE_RSA_AES_256_CBC_SHA256:256) (Exim 4.80) (envelope-from ) id 1iq1Zf-0004pl-7v; Fri, 10 Jan 2020 22:12:07 +0100 Received: by nanos.tec.linutronix.de (Postfix, from userid 1000) id BAA67105BDB; Fri, 10 Jan 2020 22:12:06 +0100 (CET) From: Thomas Gleixner To: Christophe Leroy , Benjamin Herrenschmidt , Paul Mackerras , Michael Ellerman , arnd@arndb.de, vincenzo.frascino@arm.com, luto@kernel.org Cc: linux-kernel@vger.kernel.org, linuxppc-dev@lists.ozlabs.org, linux-arm-kernel@lists.infradead.org, linux-mips@vger.kernel.org, x86@kernel.org Subject: Re: [RFC PATCH v2 07/10] lib: vdso: don't use READ_ONCE() in __c_kernel_time() In-Reply-To: References: Date: Fri, 10 Jan 2020 22:12:06 +0100 Message-ID: <87lfqfrp7d.fsf@nanos.tec.linutronix.de> MIME-Version: 1.0 Content-Type: text/plain X-Linutronix-Spam-Score: -1.0 X-Linutronix-Spam-Level: - X-Linutronix-Spam-Status: No , -1.0 points, 5.0 required, ALL_TRUSTED=-1,SHORTCIRCUIT=-0.0001 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Christophe Leroy writes: > > diff --git a/lib/vdso/gettimeofday.c b/lib/vdso/gettimeofday.c > index 17b4cff6e5f0..5a17a9d2e6cd 100644 > --- a/lib/vdso/gettimeofday.c > +++ b/lib/vdso/gettimeofday.c > @@ -144,7 +144,7 @@ __cvdso_gettimeofday(const struct vdso_data *vd, struct __kernel_old_timeval *tv > static __maybe_unused __kernel_old_time_t > __cvdso_time(const struct vdso_data *vd, __kernel_old_time_t *time) > { > - __kernel_old_time_t t = READ_ONCE(vd[CS_HRES_COARSE].basetime[CLOCK_REALTIME].sec); > + __kernel_old_time_t t = vd[CS_HRES_COARSE].basetime[CLOCK_REALTIME].sec; > > if (time) > *time = t; Allows the compiler to load twice, i.e. the returned value might be different from the stored value. So no. Thanks, tglx