Received: by 10.223.176.46 with SMTP id f43csp1005725wra; Fri, 26 Jan 2018 10:13:48 -0800 (PST) X-Google-Smtp-Source: AH8x224JAyzTgQlb083fLlMZBof5dWcGEr1pTMruc6H2UgfXSQx6FygXcW9TR/m9F4FNvMyqi2ab X-Received: by 10.101.98.133 with SMTP id f5mr8887837pgv.357.1516990428143; Fri, 26 Jan 2018 10:13:48 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1516990428; cv=none; d=google.com; s=arc-20160816; b=cy08ISoGbxqbwmlqIsvXF8Y/ndD2UP7qL//J6FkVzmMPl7qxVG0Tt9NSLbm95Uy0oc mqz7mZULoWuwI9ADV4ubliYXbOlpk0f/oS6zZ7T9WzukLCN0Gdd+++Oke6zhdcDvk5dm dsapzR8UJBtVIilihvkj742nAhFuJ2vzAzJlFCXqwKCDMB4uWfn8e/ZfQ0y5dfkH2k7c FQtxphMCRQiAt3+aSM3JnQcZqmpCoRWZp23NkfiS6uGEv+jLfG5Mq/RsatJAFNXWgIwz 8aoYQWgWtkxBj2aT0TCyD8ChxEmRq8lCuJgG+xXXgpPpIJhdyBE8BaHkqteISFmCo4X7 jFCg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:arc-authentication-results; bh=Tup5+rUUq99TYrtBytv+VtlWVB6uVwuJc21Q6XHIPBo=; b=BM5B5oN6VRabSi0wLQPNaidayTmjwCqlejTXNeeNxslze3hKoSlE40WZcWpTnLdeRB V0JTPgIfkCFzG1tmbSoI0iiBK5KxZnu72hXwlhY41NIA6LvFtdQFpc1g3ofrStiv1jvN Psm5InbVhU7nFO287wh0Iq2tgnXv65GFkQ0ktv5vJJMV+O1Q/EFenMxr0+spn0wK+475 FlTResZrgYmAn9nu/U5QVedRBb/5xzTo4lUhEYPMVhDaVefZ2yxvqxAvc6JY0qXFZ6ol dqFPukBx4IMyM3wqZ2u2/vfnHisdL8s+LYXL8l/FaAljbY2QJKmPdHwkHe0OMGZ+xeSm Dukg== 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 b21si6686884pfn.195.2018.01.26.10.13.33; Fri, 26 Jan 2018 10:13:48 -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 S1752150AbeAZSLw (ORCPT + 99 others); Fri, 26 Jan 2018 13:11:52 -0500 Received: from foss.arm.com ([217.140.101.70]:51948 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750864AbeAZSLv (ORCPT ); Fri, 26 Jan 2018 13:11:51 -0500 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.72.51.249]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 7E8161596; Fri, 26 Jan 2018 10:11:50 -0800 (PST) Received: from edgewater-inn.cambridge.arm.com (usa-sjc-imap-foss1.foss.arm.com [10.72.51.249]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPA id 4FB4A3F318; Fri, 26 Jan 2018 10:11:50 -0800 (PST) Received: by edgewater-inn.cambridge.arm.com (Postfix, from userid 1000) id 0FCD71AE10FB; Fri, 26 Jan 2018 18:11:49 +0000 (GMT) Date: Fri, 26 Jan 2018 18:11:49 +0000 From: Will Deacon To: Yury Norov Cc: linux-arm-kernel@lists.infradead.org, linux-arch@vger.kernel.org, linux-kernel@vger.kernel.org, linux-crypto@vger.kernel.org, Al Viro , Andrew Morton , Andrew Pinski , Arnd Bergmann , Catalin Marinas , "David S . Miller" , Geethasowjanya Akula , Greg Kroah-Hartman , Ingo Molnar , Kees Cook , Laura Abbott , Nicholas Piggin , Sunil Goutham Subject: Re: [PATCH RFC 0/3] API for 128-bit IO access Message-ID: <20180126181149.GA17922@arm.com> References: <20180124090519.6680-1-ynorov@caviumnetworks.com> <20180124102212.GC20586@arm.com> <20180126090542.bsza7hqqinqwllcr@yury-thinkpad> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20180126090542.bsza7hqqinqwllcr@yury-thinkpad> User-Agent: Mutt/1.5.23 (2014-03-12) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Jan 26, 2018 at 12:05:42PM +0300, Yury Norov wrote: > On Wed, Jan 24, 2018 at 10:22:13AM +0000, Will Deacon wrote: > > On Wed, Jan 24, 2018 at 12:05:16PM +0300, Yury Norov wrote: > > > This series adds API for 128-bit memory IO access and enables it for ARM64. > > > The original motivation for 128-bit API came from new Cavium network device > > > driver. The hardware requires 128-bit access to make things work. See > > > description in patch 3 for details. > > > > > > Also, starting from ARMv8.4, stp and ldp instructions become atomic, and > > > API for 128-bit access would be helpful in core arm64 code. > > > > Only for normal, cacheable memory, so they're not suitable for IO accesses > > as you're proposing here. > > Hi Will, > > Thanks for clarification. > > Could you elaborate, do you find 128-bit read/write API useless, or > you just correct my comment? > > I think that ordered uniform 128-bit access API would be helpful, even > if not atomic. Sorry, but I strongly disagree here. Having an IO accessor that isn't guaranteed to be atomic is a recipe for disaster if it's not called out explicitly. You're much better off implementing something along the lines of using 2x64-bit accessors like we already have for the 2x32-bit case. However, that doesn't solve your problem and is somewhat of a distraction. I'd suggest that in your case, where you have a device that relies on 128-bit atomic access that is assumedly tightly integrated into your SoC, then the driver just codes it's own local implementation of the accessor, given that there isn't a way to guarantee the atomicity architecturally (and even within your SoC it might not be atomic to all endpoints). Will