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 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 smtp.lore.kernel.org (Postfix) with ESMTPS id A6A39C47258 for ; Wed, 17 Jan 2024 16:06:15 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References: Message-ID:Subject:Cc:To:From:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=ddP++7ePHijUdrt9t8XjnjiVBFzPlnz0nMQll4L7gMg=; b=aA/du7xULIgVEC pMFCm0Brf4MigiF9bk/lHMg4EV+mtvokdLff1l/AVNhR/tOjyez+wh9OCjksFFLcc9mvy+qcOyMuJ DvM02TL8sDs3n/XjovWH+U05Sqh28tjiTb3sa8Ulw3ZVSW6xq4RXrdvW8YtppRbIVqcR5AfP0HXXw tWziO+nExYLtardBDo5DFHfUJSVYTGLeCcC6KOoQm2hnwQNPd7lPzE2YqsmbV/MQIwIEgI78X6/ui Xw+y4eTU31I1KBIc4oM9T2MKEHW5kQ14jLcjPJMp4bMN6XujcU6cF/AwSOum8e3ATtTnMRYdJZ9ZT 5/mOZ5Fh0GHwcBmmMlbA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1rQ8QB-00HZM4-2r; Wed, 17 Jan 2024 16:05:43 +0000 Received: from sin.source.kernel.org ([145.40.73.55]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1rQ8Q8-00HZKN-0u for linux-arm-kernel@lists.infradead.org; Wed, 17 Jan 2024 16:05:41 +0000 Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by sin.source.kernel.org (Postfix) with ESMTP id C351BCE1C88; Wed, 17 Jan 2024 16:05:35 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 9608EC433C7; Wed, 17 Jan 2024 16:05:32 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1705507535; bh=pEiz2tL8u53kCsBHC+wz183dfYKXhv0Zi1IP8ktIazY=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=WZJPHtWb0J8SqGwN3gxE0ekHZEfliftxNwuDadO0dx9f+1UakNDC8vEAcJga5RGuS TvFe0kZRcV2JcBQxWEo6ujo9hd+OmF6X01WdtVQ1jCXy+lOlu51iTSUtmooVyq50/t 8EJ3Q28yzIZHbsHPEplgyQQ8JDix487p4RaWWqCV7QQ6HSBVSBR2OKqWfc5DdzekJm M0gntltklOG2oQU5xWu1BSSwncOGGNyVpavROuo+kIPYCWEJtIdFx2NOKVg/ZYbe2m 9xJnPGuKMYCzfy8tVrtwRzs6Mt+7DPR8eCG8dxn91OVZLlfWkmasqja3x+fo2uKRkB 7proGVAMDnyKg== Date: Wed, 17 Jan 2024 16:05:29 +0000 From: Will Deacon To: Jason Gunthorpe Cc: Mark Rutland , Catalin Marinas , Niklas Schnelle , Leon Romanovsky , Arnd Bergmann , linux-arch@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-rdma@vger.kernel.org, llvm@lists.linux.dev, Michael Guralnik , Nathan Chancellor , Nick Desaulniers Subject: Re: [PATCH rdma-next 1/2] arm64/io: add memcpy_toio_64 Message-ID: <20240117160528.GA3398@willie-the-truck> References: <20231205175127.GJ2692119@nvidia.com> <20231205195130.GM2692119@nvidia.com> <20231206125919.GP2692119@nvidia.com> <20240116185121.GB980613@nvidia.com> <20240117152822.GI734935@nvidia.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20240117152822.GI734935@nvidia.com> User-Agent: Mutt/1.10.1 (2018-07-13) X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240117_080540_525524_BB294573 X-CRM114-Status: GOOD ( 16.21 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Wed, Jan 17, 2024 at 11:28:22AM -0400, Jason Gunthorpe wrote: > On Wed, Jan 17, 2024 at 02:07:16PM +0000, Mark Rutland wrote: > > > > I believe this is for the same reason as doing so in all of our other IO > > > accessors. > > > > > > We've deliberately ensured that our IO accessors use a single base register > > > with no offset as this is the only form that HW can represent in ESR_ELx.ISS.SRT > > > when reporting a stage-2 abort, which a hypervisor may use for emulating IO. > > > > FWIW, IIUC the immediate-offset forms *without* writeback can still be reported > > usefully in ESR_ELx, so I believe that we could use the "o" constraint for the > > __raw_write*() functions, e.g. > > > > static __always_inline void __raw_writeq(u64 val, volatile void __iomem *addr) > > { > > asm volatile("str %x0, %1" : : "rZ" (val), "o" (*(volatile u64 *)addr)); > > } > > "o" works well in the same simple memcpy loop: > > add x2, x1, w2, uxtw 3 > cmp x1, x2 > bcs .L1 > .L3: > ldp x10, x9, [x1] > ldp x8, x7, [x1, 16] > ldp x6, x5, [x1, 32] > ldp x4, x3, [x1, 48] > str x10, [x0] > str x9, [x0, 8] > str x8, [x0, 16] > str x7, [x0, 24] > str x6, [x0, 32] > str x5, [x0, 40] > str x4, [x0, 48] > str x3, [x0, 56] > add x1, x1, 64 > add x0, x0, 64 > cmp x2, x1 > bhi .L3 > .L1: > ret > > Seems intersting to pursue? I've seen the compiler struggle with plain "o" in the past ("Impossible constraint in asm") so we might want "Qo" if we go down this route. Will _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel