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 56DF2C04FF6 for ; Tue, 16 Apr 2024 08:30:34 +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=f0IKoRsRts2LjvW2oVMZDGE9QwIc0bpcuUkSo5ijsxM=; b=cIBo32f6Seo1H6 gdYN8ZGvBx33Kd+BmEXSN2+EHb4yr7NodojxaPQnExkEDJJ54vFAd0uNCHXEzVcV/GkjaZoysrINV CozVo1Xqgb4y5aX6xUBKH4i2oXbARz/hxUbftgtNlJCta3REGn+Keq05FEhxGgRGRQe41TIe8wPek miJKxxwjLdcVlRIGZkZLY0zKKa9CEccYXFnlZT7RbJR/sfCOax6lPDepKkGZkLyPLFGg2oKz+XoPE mNV1MdDh8brdimFyjjcy/75j5bLE/Hh9qF0GgwCfw+edG0xidFdbcWa7TCbPyRvU7gvo7u3xSLK4o vaDXBbFH1UR5NxfI5hIA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1rweCf-0000000BSNY-0F7d; Tue, 16 Apr 2024 08:30:09 +0000 Received: from dfw.source.kernel.org ([2604:1380:4641:c500::1]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1rweCb-0000000BSMO-3kG4 for linux-arm-kernel@lists.infradead.org; Tue, 16 Apr 2024 08:30:07 +0000 Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by dfw.source.kernel.org (Postfix) with ESMTP id D47B960F02; Tue, 16 Apr 2024 08:30:02 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id B131DC113CE; Tue, 16 Apr 2024 08:30:01 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1713256202; bh=lJrj9v6ekM+Ddi5L9uY9dMcBsBq+d7SARM1jH6N4GQQ=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=p61+UYgYo11o8wr+9Y1NTCQKaUdil+iO3y09VvB2XgUFcg+G0hFo9nVW748ZyFVyS jbsf9lWI/fFLW2RS99UV30A3yiEWvznNPQ8QGOUpP08u3lFxS3v2xFdx4iUVfPLLvQ kUTrfHBa2we/FaHPNnxCp/OEulJA6LTIK+TyCuJUppYn2sc73MSIfB37zKPHIXDyXM vJfCDtHbQXfm1eYIVsUEcNy+DkO2Ld937JnJ/MOVna6c+oUdYFKaKxzWRGG033qwRR LtIIu1HqZaC3Ig8eBWSR97uPo608TMUmpzBoHQXGVFzkEUxfvYwv7vLMjz8gm6l87/ XztQv707Kx+FQ== Date: Tue, 16 Apr 2024 11:29:57 +0300 From: Leon Romanovsky To: Jason Gunthorpe Cc: Alexander Gordeev , Andrew Morton , Christian Borntraeger , Borislav Petkov , Dave Hansen , "David S. Miller" , Eric Dumazet , Gerald Schaefer , Vasily Gorbik , Heiko Carstens , "H. Peter Anvin" , Justin Stitt , Jakub Kicinski , linux-rdma@vger.kernel.org, linux-s390@vger.kernel.org, llvm@lists.linux.dev, Ingo Molnar , Bill Wendling , Nathan Chancellor , Nick Desaulniers , netdev@vger.kernel.org, Paolo Abeni , Salil Mehta , Sven Schnelle , Thomas Gleixner , x86@kernel.org, Yisen Zhuang , Arnd Bergmann , Catalin Marinas , linux-arch@vger.kernel.org, linux-arm-kernel@lists.infradead.org, Mark Rutland , Michael Guralnik , patches@lists.linux.dev, Niklas Schnelle , Jijie Shao , Will Deacon Subject: Re: [PATCH v3 6/6] IB/mlx5: Use __iowrite64_copy() for write combining stores Message-ID: <20240416082957.GC6832@unreal> References: <0-v3-1893cd8b9369+1925-mlx5_arm_wc_jgg@nvidia.com> <6-v3-1893cd8b9369+1925-mlx5_arm_wc_jgg@nvidia.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <6-v3-1893cd8b9369+1925-mlx5_arm_wc_jgg@nvidia.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240416_013006_069410_D6968BF6 X-CRM114-Status: GOOD ( 20.55 ) 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 Thu, Apr 11, 2024 at 01:46:19PM -0300, Jason Gunthorpe wrote: > mlx5 has a built in self-test at driver startup to evaluate if the > platform supports write combining to generate a 64 byte PCIe TLP or > not. This has proven necessary because a lot of common scenarios end up > with broken write combining (especially inside virtual machines) and there > is other way to learn this information. > > This self test has been consistently failing on new ARM64 CPU > designs (specifically with NVIDIA Grace's implementation of Neoverse > V2). The C loop around writeq() generates some pretty terrible ARM64 > assembly, but historically this has worked on a lot of existing ARM64 CPUs > till now. > > We see it succeed about 1 time in 10,000 on the worst effected > systems. The CPU architects speculate that the load instructions > interspersed with the stores makes the WC buffers statistically flush too > often and thus the generation of large TLPs becomes infrequent. This makes > the boot up test unreliable in that it indicates no write-combining, > however userspace would be fine since it uses a ST4 instruction. > > Further, S390 has similar issues where only the special zpci_memcpy_toio() > will actually generate large TLPs, and the open coded loop does not > trigger it at all. > > Fix both ARM64 and S390 by switching to __iowrite64_copy() which now > provides architecture specific variants that have a high change of > generating a large TLP with write combining. x86 continues to use a > similar writeq loop in the generate __iowrite64_copy(). > > Fixes: 11f552e21755 ("IB/mlx5: Test write combining support") > Tested-by: Niklas Schnelle > Signed-off-by: Jason Gunthorpe > --- > drivers/infiniband/hw/mlx5/mem.c | 8 +++----- > 1 file changed, 3 insertions(+), 5 deletions(-) > Thanks, Acked-by: Leon Romanovsky _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel