Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757276AbcKXUiQ (ORCPT ); Thu, 24 Nov 2016 15:38:16 -0500 Received: from mx1.redhat.com ([209.132.183.28]:43508 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756748AbcKXUiO (ORCPT ); Thu, 24 Nov 2016 15:38:14 -0500 Date: Thu, 24 Nov 2016 22:36:58 +0200 From: "Michael S. Tsirkin" To: Mark Rutland Cc: linux-kernel@vger.kernel.org, dave@stgolabs.net, dbueso@suse.de, dvyukov@google.com, jasowang@redhat.com, kvm@vger.kernel.org, netdev@vger.kernel.org, paulmck@linux.vnet.ibm.com, virtualization@lists.linux-foundation.org Subject: Re: [PATCH 0/3] virtio/vringh: kill off ACCESS_ONCE() Message-ID: <20161124222357-mutt-send-email-mst@kernel.org> References: <1479983114-17190-1-git-send-email-mark.rutland@arm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1479983114-17190-1-git-send-email-mark.rutland@arm.com> X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.28]); Thu, 24 Nov 2016 20:37:00 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1395 Lines: 38 On Thu, Nov 24, 2016 at 10:25:11AM +0000, Mark Rutland wrote: > For several reasons, it would be beneficial to kill off ACCESS_ONCE() > tree-wide, in favour of {READ,WRITE}_ONCE(). These work with aggregate types, > more obviously document their intended behaviour, and are necessary for tools > like KTSAN to work correctly (as otherwise reads and writes cannot be > instrumented separately). > > While it's possible to script the bulk of this tree-wide conversion, some cases > such as the virtio code, require some manual intervention. This series moves > the virtio and vringh code over to {READ,WRITE}_ONCE(), in the process fixing a > bug in the virtio headers. > > Thanks, > Mark. I don't have a problem with this specific patchset. Though I really question the whole _ONCE APIs esp with aggregate types - these seem to generate a memcpy and an 8-byte read/writes sometimes, and I'm pretty sure this simply can't be read/written at once on all architectures. So I worry it's kind of like volatile in this respect, too easy to overuse. > Mark Rutland (3): > tools/virtio: fix READ_ONCE() > vringh: kill off ACCESS_ONCE() > tools/virtio: use {READ,WRITE}_ONCE() in uaccess.h > > drivers/vhost/vringh.c | 5 +++-- > tools/virtio/linux/compiler.h | 2 +- > tools/virtio/linux/uaccess.h | 9 +++++---- > 3 files changed, 9 insertions(+), 7 deletions(-) > > -- > 2.7.4