From mboxrd@z Thu Jan 1 00:00:00 1970 From: David Laight Subject: RE: [RFT 00/13] iomap: Constify ioreadX() iomem argument Date: Wed, 8 Jan 2020 17:39:42 +0000 Message-ID: <334434313e1642768995acc03a51214f@AcuMS.aculab.com> References: <1578415992-24054-1-git-send-email-krzk@kernel.org> <2355489c-a207-1927-54cf-85c04b62f18f@c-s.fr> <00a43e5c-0708-d49a-9cc4-eb2ce8b4cf99@c-s.fr> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <00a43e5c-0708-d49a-9cc4-eb2ce8b4cf99@c-s.fr> Content-Language: en-US List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: virtualization-bounces@lists.linux-foundation.org Sender: "Virtualization" To: 'Christophe Leroy' , Geert Uytterhoeven Cc: Rich Felker , Jiri Slaby , "Michael S. Tsirkin" , David Airlie , "nouveau@lists.freedesktop.org" , DRI Development , "virtualization@lists.linux-foundation.org" , "James E.J. Bottomley" , Paul Mackerras , Linux-Arch , Dave Jiang , Yoshinori Sato , Helge Deller , Linux-sh list , Alexey Brodkin , Krzysztof Kozlowski , Ben Skeggs , Dave Airlie , Matt Turner , arcml , Nick Kossifidis List-Id: linux-arch.vger.kernel.org From: Christophe Leroy > Sent: 08 January 2020 08:49 ... > And as pointed by Arnd, the volatile is really only necessary for the > dereference itself, should the arch use dereferencing. I've had trouble with some versions of gcc and reading of 'volatile unsigned char *'. It tended to follow the memory read with an extra mask with 0xff. (I suspect that internally the value landed into a temporary 'int' variable.) I got better code using memory barriers. So putting an asm barrier for the exact location of the memory read either side of the read should have the desired effect without adding extra instructions. (You might think 'volatile' would mean that - but it doesn't.) David - Registered Address Lakeside, Bramley Road, Mount Farm, Milton Keynes, MK1 1PT, UK Registration No: 1397386 (Wales) From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-0.8 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id EAEA7C282DD for ; Wed, 8 Jan 2020 21:44:16 +0000 (UTC) Received: from lists.ozlabs.org (lists.ozlabs.org [203.11.71.2]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 221F620692 for ; Wed, 8 Jan 2020 21:44:15 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 221F620692 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=ACULAB.COM Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=linuxppc-dev-bounces+linuxppc-dev=archiver.kernel.org@lists.ozlabs.org Received: from lists.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) by lists.ozlabs.org (Postfix) with ESMTP id 47tN7104NszDqQw for ; Thu, 9 Jan 2020 08:44:13 +1100 (AEDT) Authentication-Results: lists.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=aculab.com (client-ip=146.101.78.151; helo=eu-smtp-delivery-151.mimecast.com; envelope-from=david.laight@aculab.com; receiver=) Authentication-Results: lists.ozlabs.org; dmarc=none (p=none dis=none) header.from=ACULAB.COM Received: from eu-smtp-delivery-151.mimecast.com (eu-smtp-delivery-151.mimecast.com [146.101.78.151]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 47tN4m5kNrzDqWP for ; Thu, 9 Jan 2020 08:42:13 +1100 (AEDT) Received: from AcuMS.aculab.com (156.67.243.126 [156.67.243.126]) (Using TLS) by relay.mimecast.com with ESMTP id uk-mta-2-XMFewsroMBqNVmL4iq_bTQ-1; Wed, 08 Jan 2020 17:39:44 +0000 Received: from AcuMS.Aculab.com (fd9f:af1c:a25b:0:43c:695e:880f:8750) by AcuMS.aculab.com (fd9f:af1c:a25b:0:43c:695e:880f:8750) with Microsoft SMTP Server (TLS) id 15.0.1347.2; Wed, 8 Jan 2020 17:39:42 +0000 Received: from AcuMS.Aculab.com ([fe80::43c:695e:880f:8750]) by AcuMS.aculab.com ([fe80::43c:695e:880f:8750%12]) with mapi id 15.00.1347.000; Wed, 8 Jan 2020 17:39:42 +0000 From: David Laight To: 'Christophe Leroy' , Geert Uytterhoeven Subject: RE: [RFT 00/13] iomap: Constify ioreadX() iomem argument Thread-Topic: [RFT 00/13] iomap: Constify ioreadX() iomem argument Thread-Index: AQHVxgB0oW/g95TA9k2fcgn+xgLf36fhB6DA Date: Wed, 8 Jan 2020 17:39:42 +0000 Message-ID: <334434313e1642768995acc03a51214f@AcuMS.aculab.com> References: <1578415992-24054-1-git-send-email-krzk@kernel.org> <2355489c-a207-1927-54cf-85c04b62f18f@c-s.fr> <00a43e5c-0708-d49a-9cc4-eb2ce8b4cf99@c-s.fr> In-Reply-To: <00a43e5c-0708-d49a-9cc4-eb2ce8b4cf99@c-s.fr> Accept-Language: en-GB, en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-ms-exchange-transport-fromentityheader: Hosted x-originating-ip: [10.202.205.107] MIME-Version: 1.0 X-MC-Unique: XMFewsroMBqNVmL4iq_bTQ-1 X-Mimecast-Spam-Score: 0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: base64 X-BeenThere: linuxppc-dev@lists.ozlabs.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Linux on PowerPC Developers Mail List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Rich Felker , Jiri Slaby , "Michael S. Tsirkin" , David Airlie , "nouveau@lists.freedesktop.org" , Jason Wang , DRI Development , "virtualization@lists.linux-foundation.org" , "James E.J. Bottomley" , Paul Mackerras , Linux-Arch , Dave Jiang , Yoshinori Sato , Helge Deller , Linux-sh list , Alexey Brodkin , Krzysztof Kozlowski , Ben Skeggs , Dave Airlie , Matt Turner , arcml , Nick Kossifidis , Allen Hubbe , Arnd Bergmann , Jon Mason , Ivan Kokshaysky , Thomas Gleixner , Mauro Carvalho Chehab , Kalle Valo , Richard Henderson , Parisc List , netdev , linux-wireless , Linux Kernel Mailing List , Luis Chamberlain , Vineet Gupta , Daniel Vetter , alpha , "linux-ntb@googlegroups.com" , Andrew Morton , Linux Media Mailing List , linuxppc-dev , "David S. Miller" Errors-To: linuxppc-dev-bounces+linuxppc-dev=archiver.kernel.org@lists.ozlabs.org Sender: "Linuxppc-dev" RnJvbTogQ2hyaXN0b3BoZSBMZXJveQ0KPiBTZW50OiAwOCBKYW51YXJ5IDIwMjAgMDg6NDkNCi4u Lg0KPiBBbmQgYXMgcG9pbnRlZCBieSBBcm5kLCB0aGUgdm9sYXRpbGUgaXMgcmVhbGx5IG9ubHkg bmVjZXNzYXJ5IGZvciB0aGUNCj4gZGVyZWZlcmVuY2UgaXRzZWxmLCBzaG91bGQgdGhlIGFyY2gg dXNlIGRlcmVmZXJlbmNpbmcuDQoNCkkndmUgaGFkIHRyb3VibGUgd2l0aCBzb21lIHZlcnNpb25z IG9mIGdjYyBhbmQgcmVhZGluZyBvZiAndm9sYXRpbGUgdW5zaWduZWQgY2hhciAqJy4NCkl0IHRl bmRlZCB0byBmb2xsb3cgdGhlIG1lbW9yeSByZWFkIHdpdGggYW4gZXh0cmEgbWFzayB3aXRoIDB4 ZmYuDQooSSBzdXNwZWN0IHRoYXQgaW50ZXJuYWxseSB0aGUgdmFsdWUgbGFuZGVkIGludG8gYSB0 ZW1wb3JhcnkgJ2ludCcgdmFyaWFibGUuKQ0KDQpJIGdvdCBiZXR0ZXIgY29kZSB1c2luZyBtZW1v cnkgYmFycmllcnMuDQpTbyBwdXR0aW5nIGFuIGFzbSBiYXJyaWVyIGZvciB0aGUgZXhhY3QgbG9j YXRpb24gb2YgdGhlIG1lbW9yeSByZWFkDQplaXRoZXIgc2lkZSBvZiB0aGUgcmVhZCBzaG91bGQg aGF2ZSB0aGUgZGVzaXJlZCBlZmZlY3Qgd2l0aG91dCBhZGRpbmcNCmV4dHJhIGluc3RydWN0aW9u cy4NCihZb3UgbWlnaHQgdGhpbmsgJ3ZvbGF0aWxlJyB3b3VsZCBtZWFuIHRoYXQgLSBidXQgaXQg ZG9lc24ndC4pDQoNCglEYXZpZA0KDQotDQpSZWdpc3RlcmVkIEFkZHJlc3MgTGFrZXNpZGUsIEJy YW1sZXkgUm9hZCwgTW91bnQgRmFybSwgTWlsdG9uIEtleW5lcywgTUsxIDFQVCwgVUsNClJlZ2lz dHJhdGlvbiBObzogMTM5NzM4NiAoV2FsZXMpDQo= From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-0.8 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 2AF39C282DD for ; Wed, 8 Jan 2020 17:40:22 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id F333720692 for ; Wed, 8 Jan 2020 17:40:21 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="pRYB3o/T"; dkim=fail reason="signature verification failed" (2048-bit key) header.d=infradead.org header.i=@infradead.org header.b="u/qKB30A" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org F333720692 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=ACULAB.COM Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-snps-arc-bounces+linux-snps-arc=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:In-Reply-To:References: Message-ID:Date:Subject:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=zDylXeYbQYWMsUofnlTJcxpne9AfgYfZnpGWHo1rGNw=; b=pRYB3o/TbOpxyw OU2SisRwMaBbdJ/Rz0/EJYFj9n5PWbUu6ZSWw2BDCu7lSCtQHZk5QYEi1EZD3J0j44UaAEXpLMU1h SjCRytRO9/nHmPZMDI8sQmmUusVR0cHMazLJ2fZj5k1qS3Nglnw+vRRtTHoidIeYQFzKW3hu8jzOk 9LGoWn+BiIdH1ko5+V4uYGuoE5VEKicukN/cXprUnm6YrCjzUM4ZKaPb429AZJ1ZwiO2lELesfjM7 ffMgNWxGIeaXKWSYYUMWXSpgiwH8bdkvTJI7lzYMKwjkaJRvKm7qO2rQ1HMz00OFWTb/mQnpTxflB Xt/OnV+BRDiCMRPfceEw==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1ipFJc-00026M-Ur; Wed, 08 Jan 2020 17:40:20 +0000 Received: from casper.infradead.org ([2001:8b0:10b:1236::1]) by bombadil.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1ipFJb-00026E-Ha for linux-snps-arc@bombadil.infradead.org; Wed, 08 Jan 2020 17:40:19 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; h=Content-Transfer-Encoding:Content-Type: MIME-Version:In-Reply-To:References:Message-ID:Date:Subject:CC:To:From:Sender :Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help: List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=isDE66TDzLwOPMoBB+GwF0KLMbySHhbhBl4lSkj7SXc=; b=u/qKB30AF2b7ndto2xFcR21A7t AU7lg5opJt13ZdIg/safWpr+5D0XqmfZ8or1Blv04+cUUC8RWOO5Ym3b/hPpcWKuJ3O8kDDNSIZbb kz88mZGIfQ9kt9574CCaKQSMw2B/9PXAeTI299Qo2N2A5dabA7PgBMTHVLXMTIl8IsAvoDjdmqBK4 xS25eJ9t/hImgN9p1IpmB/sptMPK4BXBpPIoTMqEoesWoVLgpOi19Bhw63ZhCoqkZs06iYER6jm/w S1N9c9SlYh+WViwFJjfQxLx7sIr6nfKx0q3jRfb8bkid6EZKhiYdZ77IEq1WhHEcV3R0RAZfI4I5y D0Ldf15A==; Received: from eu-smtp-delivery-151.mimecast.com ([207.82.80.151]) by casper.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1ipFJz-0005XC-GW for linux-snps-arc@lists.infradead.org; Wed, 08 Jan 2020 17:40:45 +0000 Received: from AcuMS.aculab.com (156.67.243.126 [156.67.243.126]) (Using TLS) by relay.mimecast.com with ESMTP id uk-mta-2-XMFewsroMBqNVmL4iq_bTQ-1; Wed, 08 Jan 2020 17:39:44 +0000 Received: from AcuMS.Aculab.com (fd9f:af1c:a25b:0:43c:695e:880f:8750) by AcuMS.aculab.com (fd9f:af1c:a25b:0:43c:695e:880f:8750) with Microsoft SMTP Server (TLS) id 15.0.1347.2; Wed, 8 Jan 2020 17:39:42 +0000 Received: from AcuMS.Aculab.com ([fe80::43c:695e:880f:8750]) by AcuMS.aculab.com ([fe80::43c:695e:880f:8750%12]) with mapi id 15.00.1347.000; Wed, 8 Jan 2020 17:39:42 +0000 From: David Laight To: 'Christophe Leroy' , Geert Uytterhoeven Subject: RE: [RFT 00/13] iomap: Constify ioreadX() iomem argument Thread-Topic: [RFT 00/13] iomap: Constify ioreadX() iomem argument Thread-Index: AQHVxgB0oW/g95TA9k2fcgn+xgLf36fhB6DA Date: Wed, 8 Jan 2020 17:39:42 +0000 Message-ID: <334434313e1642768995acc03a51214f@AcuMS.aculab.com> References: <1578415992-24054-1-git-send-email-krzk@kernel.org> <2355489c-a207-1927-54cf-85c04b62f18f@c-s.fr> <00a43e5c-0708-d49a-9cc4-eb2ce8b4cf99@c-s.fr> In-Reply-To: <00a43e5c-0708-d49a-9cc4-eb2ce8b4cf99@c-s.fr> Accept-Language: en-GB, en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-ms-exchange-transport-fromentityheader: Hosted x-originating-ip: [10.202.205.107] MIME-Version: 1.0 X-MC-Unique: XMFewsroMBqNVmL4iq_bTQ-1 X-Mimecast-Spam-Score: 0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20200108_174043_585288_92013646 X-CRM114-Status: UNSURE ( 8.55 ) X-CRM114-Notice: Please train this message. X-BeenThere: linux-snps-arc@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Linux on Synopsys ARC Processors List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Rich Felker , Jiri Slaby , "Michael S. Tsirkin" , David Airlie , "nouveau@lists.freedesktop.org" , Jason Wang , DRI Development , "virtualization@lists.linux-foundation.org" , "James E.J. Bottomley" , Paul Mackerras , Linux-Arch , Dave Jiang , Yoshinori Sato , Helge Deller , Linux-sh list , Alexey Brodkin , Krzysztof Kozlowski , Ben Skeggs , Dave Airlie , Matt Turner , arcml , Nick Kossifidis , Allen Hubbe , Arnd Bergmann , Jon Mason , Ivan Kokshaysky , Thomas Gleixner , Mauro Carvalho Chehab , Kalle Valo , Richard Henderson , Parisc List , netdev , linux-wireless , Linux Kernel Mailing List , Luis Chamberlain , Vineet Gupta , Daniel Vetter , alpha , "linux-ntb@googlegroups.com" , Andrew Morton , Linux Media Mailing List , linuxppc-dev , "David S. Miller" Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-snps-arc" Errors-To: linux-snps-arc-bounces+linux-snps-arc=archiver.kernel.org@lists.infradead.org From: Christophe Leroy > Sent: 08 January 2020 08:49 ... > And as pointed by Arnd, the volatile is really only necessary for the > dereference itself, should the arch use dereferencing. I've had trouble with some versions of gcc and reading of 'volatile unsigned char *'. It tended to follow the memory read with an extra mask with 0xff. (I suspect that internally the value landed into a temporary 'int' variable.) I got better code using memory barriers. So putting an asm barrier for the exact location of the memory read either side of the read should have the desired effect without adding extra instructions. (You might think 'volatile' would mean that - but it doesn't.) David - Registered Address Lakeside, Bramley Road, Mount Farm, Milton Keynes, MK1 1PT, UK Registration No: 1397386 (Wales) _______________________________________________ linux-snps-arc mailing list linux-snps-arc@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-snps-arc From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-0.8 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id E1282C33CA2 for ; Thu, 9 Jan 2020 17:51:47 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id C333520678 for ; Thu, 9 Jan 2020 17:51:47 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org C333520678 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=ACULAB.COM Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=dri-devel-bounces@lists.freedesktop.org Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 262256E930; Thu, 9 Jan 2020 17:51:30 +0000 (UTC) X-Greylist: delayed 303 seconds by postgrey-1.36 at gabe; Wed, 08 Jan 2020 17:46:05 UTC Received: from eu-smtp-delivery-151.mimecast.com (eu-smtp-delivery-151.mimecast.com [146.101.78.151]) by gabe.freedesktop.org (Postfix) with ESMTPS id 13D0C6E1DE for ; Wed, 8 Jan 2020 17:46:04 +0000 (UTC) Received: from AcuMS.aculab.com (156.67.243.126 [156.67.243.126]) (Using TLS) by relay.mimecast.com with ESMTP id uk-mta-2-XMFewsroMBqNVmL4iq_bTQ-1; Wed, 08 Jan 2020 17:39:44 +0000 Received: from AcuMS.Aculab.com (fd9f:af1c:a25b:0:43c:695e:880f:8750) by AcuMS.aculab.com (fd9f:af1c:a25b:0:43c:695e:880f:8750) with Microsoft SMTP Server (TLS) id 15.0.1347.2; Wed, 8 Jan 2020 17:39:42 +0000 Received: from AcuMS.Aculab.com ([fe80::43c:695e:880f:8750]) by AcuMS.aculab.com ([fe80::43c:695e:880f:8750%12]) with mapi id 15.00.1347.000; Wed, 8 Jan 2020 17:39:42 +0000 From: David Laight To: 'Christophe Leroy' , Geert Uytterhoeven Subject: RE: [RFT 00/13] iomap: Constify ioreadX() iomem argument Thread-Topic: [RFT 00/13] iomap: Constify ioreadX() iomem argument Thread-Index: AQHVxgB0oW/g95TA9k2fcgn+xgLf36fhB6DA Date: Wed, 8 Jan 2020 17:39:42 +0000 Message-ID: <334434313e1642768995acc03a51214f@AcuMS.aculab.com> References: <1578415992-24054-1-git-send-email-krzk@kernel.org> <2355489c-a207-1927-54cf-85c04b62f18f@c-s.fr> <00a43e5c-0708-d49a-9cc4-eb2ce8b4cf99@c-s.fr> In-Reply-To: <00a43e5c-0708-d49a-9cc4-eb2ce8b4cf99@c-s.fr> Accept-Language: en-GB, en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-ms-exchange-transport-fromentityheader: Hosted x-originating-ip: [10.202.205.107] MIME-Version: 1.0 X-MC-Unique: XMFewsroMBqNVmL4iq_bTQ-1 X-Mimecast-Spam-Score: 0 X-Mailman-Approved-At: Thu, 09 Jan 2020 17:51:28 +0000 X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Rich Felker , Jiri Slaby , "Michael S. Tsirkin" , David Airlie , "nouveau@lists.freedesktop.org" , Jason Wang , DRI Development , "virtualization@lists.linux-foundation.org" , "James E.J. Bottomley" , Paul Mackerras , Linux-Arch , Dave Jiang , Yoshinori Sato , Helge Deller , Linux-sh list , Alexey Brodkin , Krzysztof Kozlowski , Ben Skeggs , Dave Airlie , Matt Turner , arcml , Nick Kossifidis , Allen Hubbe , Arnd Bergmann , Jon Mason , Ivan Kokshaysky , Thomas Gleixner , Mauro Carvalho Chehab , Kalle Valo , Richard Henderson , Parisc List , netdev , linux-wireless , Linux Kernel Mailing List , Luis Chamberlain , Vineet Gupta , alpha , "linux-ntb@googlegroups.com" , Andrew Morton , Linux Media Mailing List , linuxppc-dev , "David S. Miller" Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" From: Christophe Leroy > Sent: 08 January 2020 08:49 ... > And as pointed by Arnd, the volatile is really only necessary for the > dereference itself, should the arch use dereferencing. I've had trouble with some versions of gcc and reading of 'volatile unsigned char *'. It tended to follow the memory read with an extra mask with 0xff. (I suspect that internally the value landed into a temporary 'int' variable.) I got better code using memory barriers. So putting an asm barrier for the exact location of the memory read either side of the read should have the desired effect without adding extra instructions. (You might think 'volatile' would mean that - but it doesn't.) David - Registered Address Lakeside, Bramley Road, Mount Farm, Milton Keynes, MK1 1PT, UK Registration No: 1397386 (Wales) _______________________________________________ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from eu-smtp-delivery-151.mimecast.com (eu-smtp-delivery-151.mimecast.com. [207.82.80.151]) by gmr-mx.google.com with ESMTPS id ba12si165640edb.3.2020.01.08.09.39.46 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 08 Jan 2020 09:39:46 -0800 (PST) From: David Laight Subject: RE: [RFT 00/13] iomap: Constify ioreadX() iomem argument Date: Wed, 8 Jan 2020 17:39:42 +0000 Message-ID: <334434313e1642768995acc03a51214f@AcuMS.aculab.com> References: <1578415992-24054-1-git-send-email-krzk@kernel.org> <2355489c-a207-1927-54cf-85c04b62f18f@c-s.fr> <00a43e5c-0708-d49a-9cc4-eb2ce8b4cf99@c-s.fr> In-Reply-To: <00a43e5c-0708-d49a-9cc4-eb2ce8b4cf99@c-s.fr> Content-Language: en-US MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: base64 To: 'Christophe Leroy' , Geert Uytterhoeven Cc: Krzysztof Kozlowski , Rich Felker , Jiri Slaby , "Michael S. Tsirkin" , David Airlie , Jason Wang , DRI Development , "virtualization@lists.linux-foundation.org" , "James E.J. Bottomley" , netdev , Paul Mackerras , Linux-Arch , Dave Jiang , Yoshinori Sato , Helge Deller , Linux-sh list , Alexey Brodkin , Ben Skeggs , "nouveau@lists.freedesktop.org" , Dave Airlie , Matt Turner , arcml , Nick Kossifidis , Allen Hubbe , Arnd Bergmann , alpha , Ivan Kokshaysky , Thomas Gleixner , Mauro Carvalho Chehab , Kalle Valo , Richard Henderson , Parisc List , Vineet Gupta , linux-wireless , Linux Kernel Mailing List , Luis Chamberlain , Daniel Vetter , Jon Mason , "linux-ntb@googlegroups.com" , Andrew Morton , Linux Media Mailing List , linuxppc-dev , "David S. Miller" List-ID: RnJvbTogQ2hyaXN0b3BoZSBMZXJveQ0KPiBTZW50OiAwOCBKYW51YXJ5IDIwMjAgMDg6NDkNCi4u Lg0KPiBBbmQgYXMgcG9pbnRlZCBieSBBcm5kLCB0aGUgdm9sYXRpbGUgaXMgcmVhbGx5IG9ubHkg bmVjZXNzYXJ5IGZvciB0aGUNCj4gZGVyZWZlcmVuY2UgaXRzZWxmLCBzaG91bGQgdGhlIGFyY2gg dXNlIGRlcmVmZXJlbmNpbmcuDQoNCkkndmUgaGFkIHRyb3VibGUgd2l0aCBzb21lIHZlcnNpb25z IG9mIGdjYyBhbmQgcmVhZGluZyBvZiAndm9sYXRpbGUgdW5zaWduZWQgY2hhciAqJy4NCkl0IHRl bmRlZCB0byBmb2xsb3cgdGhlIG1lbW9yeSByZWFkIHdpdGggYW4gZXh0cmEgbWFzayB3aXRoIDB4 ZmYuDQooSSBzdXNwZWN0IHRoYXQgaW50ZXJuYWxseSB0aGUgdmFsdWUgbGFuZGVkIGludG8gYSB0 ZW1wb3JhcnkgJ2ludCcgdmFyaWFibGUuKQ0KDQpJIGdvdCBiZXR0ZXIgY29kZSB1c2luZyBtZW1v cnkgYmFycmllcnMuDQpTbyBwdXR0aW5nIGFuIGFzbSBiYXJyaWVyIGZvciB0aGUgZXhhY3QgbG9j YXRpb24gb2YgdGhlIG1lbW9yeSByZWFkDQplaXRoZXIgc2lkZSBvZiB0aGUgcmVhZCBzaG91bGQg aGF2ZSB0aGUgZGVzaXJlZCBlZmZlY3Qgd2l0aG91dCBhZGRpbmcNCmV4dHJhIGluc3RydWN0aW9u cy4NCihZb3UgbWlnaHQgdGhpbmsgJ3ZvbGF0aWxlJyB3b3VsZCBtZWFuIHRoYXQgLSBidXQgaXQg ZG9lc24ndC4pDQoNCglEYXZpZA0KDQotDQpSZWdpc3RlcmVkIEFkZHJlc3MgTGFrZXNpZGUsIEJy YW1sZXkgUm9hZCwgTW91bnQgRmFybSwgTWlsdG9uIEtleW5lcywgTUsxIDFQVCwgVUsNClJlZ2lz dHJhdGlvbiBObzogMTM5NzM4NiAoV2FsZXMpDQo=