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 kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id 50BB3C3ABC0 for ; Thu, 8 May 2025 12:30:57 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id D278B6B0085; Thu, 8 May 2025 08:30:55 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id CD5496B0088; Thu, 8 May 2025 08:30:55 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id B9BF76B0089; Thu, 8 May 2025 08:30:55 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0012.hostedemail.com [216.40.44.12]) by kanga.kvack.org (Postfix) with ESMTP id 98F436B0085 for ; Thu, 8 May 2025 08:30:55 -0400 (EDT) Received: from smtpin19.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay10.hostedemail.com (Postfix) with ESMTP id 593AAC015D for ; Thu, 8 May 2025 12:30:56 +0000 (UTC) X-FDA: 83419674912.19.3752319 Received: from sea.source.kernel.org (sea.source.kernel.org [172.234.252.31]) by imf06.hostedemail.com (Postfix) with ESMTP id 601DC180008 for ; Thu, 8 May 2025 12:30:54 +0000 (UTC) Authentication-Results: imf06.hostedemail.com; dkim=pass header.d=kernel.org header.s=k20201202 header.b="Rd6u/bQW"; dmarc=pass (policy=quarantine) header.from=kernel.org; spf=pass (imf06.hostedemail.com: domain of will@kernel.org designates 172.234.252.31 as permitted sender) smtp.mailfrom=will@kernel.org ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1746707454; a=rsa-sha256; cv=none; b=7JcZyCKDNVzWK3p6GBz20c5BNLIr1rsA3APSZw5+4ENsY/d0xAcqVwvIqQ3CBZw6J30i0R J0B5aF5CNw3/mCFMWxac+oiipsuP7v3udhTSHrvY694TInYIKZDZ7zUz23zDp/jwOJs/+m O4IwX8gOMZb8j307MY130sM44nHf5G0= ARC-Authentication-Results: i=1; imf06.hostedemail.com; dkim=pass header.d=kernel.org header.s=k20201202 header.b="Rd6u/bQW"; dmarc=pass (policy=quarantine) header.from=kernel.org; spf=pass (imf06.hostedemail.com: domain of will@kernel.org designates 172.234.252.31 as permitted sender) smtp.mailfrom=will@kernel.org ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1746707454; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=f12dV12I+MMps004lAe5FKDU+d0MmRTfY8S6E4Wcg94=; b=uKLfe14InEKkVHIf5A/U6N/WI/ODCFVcQvLhNV5//QyVbgsciW6xwF2RKhsJJEhw8k1pcH 4cJKDKWOtYWGC7dGQEVLVJjbTbtVZhKc1ZsraRaYK1+Qk7aoDYVM21GZWJQm3x/A/ghy3L El+QlP/WsyiMbqX0DBsqAWoPOWTv6+M= Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by sea.source.kernel.org (Postfix) with ESMTP id 008C24442B; Thu, 8 May 2025 12:30:53 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 993C4C4CEE7; Thu, 8 May 2025 12:30:50 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1746707452; bh=JJPW3pg6cZkOHMvhRauntwsoTRRsn+zJqEIoKIpwLkA=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=Rd6u/bQWZ8gH7/YC5SBwtNOV0WXVhjwJPQcJXV4yEaBgZGUr/9yakFCWFIrid5i3B 2cd6AKn9b1tHMbXMjCap5Aalj6FU/kxG7T9sHDnYt62R0t3OKjw6PgJkhTM0mPFe6C GNgG4SpCW7VMMw/iOkkg+9hz0osB11J1AK2yMuPM9Shh9VnU3a6HvhrRuK6LTJIgFH 15G59Gnv4i6F4W+ozSABchoqW55c/xDsYEwfYn1HwokfWMcjYGQVYjSPSbCtsfhl4A MyIP16eXwmNt7J8w7vqPawTLf+oxHIeDInhMFzIvxTA450HKB2/Z8iiwgJmPC5NndM jZ4aiuiEcvCNw== Date: Thu, 8 May 2025 13:30:47 +0100 From: Will Deacon To: Alexandre Ghiti Cc: Ryan Roberts , Alexandre Ghiti , Catalin Marinas , Mark Rutland , Matthew Wilcox , Paul Walmsley , Palmer Dabbelt , Andrew Morton , linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-riscv@lists.infradead.org, linux-mm@kvack.org Subject: Re: [PATCH v5 0/9] Merge arm64/riscv hugetlbfs contpte support Message-ID: <20250508123046.GA3706@willie-the-truck> References: <20250321130635.227011-1-alexghiti@rivosinc.com> <4dd5d187-f977-4f27-9937-8608991797b5@ghiti.fr> <64409a13-1c07-42cd-b1ec-572042738f1b@arm.com> <84cb893a-46e3-408a-ba0e-2eff0b44d2a1@ghiti.fr> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <84cb893a-46e3-408a-ba0e-2eff0b44d2a1@ghiti.fr> User-Agent: Mutt/1.10.1 (2018-07-13) X-Rspamd-Server: rspam03 X-Rspamd-Queue-Id: 601DC180008 X-Stat-Signature: qeege9kfyfgbyryiq7dkom4ya44dio61 X-Rspam-User: X-HE-Tag: 1746707454-9208 X-HE-Meta: U2FsdGVkX1948ooFINmxm4Su/MuAjZ2xTziRfQ3ahMdd1mVykPr9Nkz77EdbTmgEP8o/SFMNWvULDYoe3SPO4EJ6w0F9ae85fiqvMVJdlrOfxJXkaiSDWrXN4kLX11usO4Rd7p5wbxoKsGDS4hfeCHh/IioE+xXlLSVSEQu3hwzgRWqbSfQwWF7hO8TeirPlW14lnelQQCSL0J9d837OPMabAkNXH+LjuGAwA6WIqpilRc89gVKQlR98z4XUAwoZWiKkOdkM2HJuPMDjFxabuctd8oGwv30aeD7zM985sESz+jQkCc/TX9y+aJAwhjA83igk4H5vOZBgYDjQZ2mtmElpujFccwiw8ChOGdsFTZHm4j+qGXuc+0ju4sXKp+WlOhfsPitP+2HsG1ASdB1iT0JGfSr+uyUCKTpIYQe3ulGUXqvMx30M6axE2Xr59LVp5LcrI/1364B9PayXyA1p721+2JnRRRAuyPHnw1m/c6bSA2Oqk7rYvqrkcpb9VgRw7IZvFqN5cmqH7B1Lr/Kx5Rzg5/eAK+qMm1dDxAkjU6NgLvaXx6J/9W4PXhPx8LUpts5frZLwZmJ9EyNdVSAhO1RXHH5xXZ6GkZplv5WuNJ/vEHkJOjQtDXEc6YI8I6z9wU9/Q4jxOZv8uWqd81AqlTMdQ6/BQPIc4EDx9lx5/vfqduOLm6bDBbFpLnbGb8VziYtuXOfotvLWhHTiwqGIHid/IGFDtRCo3anhd05sLI/bzZjSlWL0uxWnZMhGa+vbbNE6/miS3prLJVN1mAX02xZYpCt8EmMchHcWx/Z6yCcO4AZR8Ruc5m/53AMBRDMtWMCn8sTjWbmlYnc1Y70k0JP7/w7NBO6xD7DaAU2comxY7BT4NnBuVKtdqA7HbaY4smxg3GQvQ6gnFLcZXQ60rpT3NOUzBbq9Nkl/GHdaeNAIjBWbs6glrCt42osbiUtOCqOxu8/slnZkOqXAXX+ EidrnaS2 SXaPrk0NXZpwWjiG+zElL12Z4+yJDRYYGLX9379nMfc4WemLzP2UttXrZB0wIFyHMEY+0CX+WoohXuQabFRBt5wd1JyNHTxxz/D30Tg80Rvy0LLKOQX46KEvKKNplNgGNzeSQl3KIf2s0f0pSy7bHrWDW9NFrxn9ziNuQdKB6l65KyeeuQT4m/kRl7ZurI2VGBetSQIPFOShAUbeQU2b7ZhNHJut+Kp6bChTE X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: List-Subscribe: List-Unsubscribe: Hi folks, On Mon, May 05, 2025 at 06:08:50PM +0200, Alexandre Ghiti wrote: > On 29/04/2025 16:09, Ryan Roberts wrote: > > On 07/04/2025 13:04, Alexandre Ghiti wrote: > > > Can someone from arm64 review this? I think it's preferable to share the same > > > implementation between riscv and arm64. > > I've been thinking about this for a while and had some conversations internally. > > This patchset has both pros and cons. > > > > In the pros column, it increases code reuse in an area that has had quite of few > > bugs popping up lately; so this would bring more eyes and hopefully higher > > quality in the long run. > > > > But in the cons column, we have seen HW errata in similar areas in the past and > > I'm nervous that by hoisting this code to mm, we make it harder to workaround > > any future errata. Additionally I can imagine that this change could make it > > harder to support future Arm architecture enhancements. > > > > I appreciate the cons are not strong *technical* arguments but nevertheless they > > are winning out in this case; My opinion is that we should keep the arm64 > > implementations of huge_pte_ (and contpte_ too - I know you have a separate > > series for this) private to arm64. > > > > Sorry about that. > > > > > The end goal is the support of mTHP using svnapot on riscv, which we want soon, > > > so if that patchset does not gain any traction, I'll just copy/paste the arm64 > > > implementation into riscv. > > This copy/paste approach would be my preference. > > > I have to admit that I disagree with this approach, the riscv and arm64 > implementations are *exactly* the same so it sounds weird to duplicate code, > the pros you mention outweigh the cons. > > Unless I'm missing something about the erratas? To me, that's easily fixed > by providing arch specific overrides no? Can you describe what sort of > erratas would not fit then? If we start with the common implementation you have here, nothing prevents us from forking the code in future if the architectures diverge so I'd be inclined to merge this series and see how we get on. However, one thing I *do* think we need to ensure is that the relevant folks from both arm64 (i.e. Ryan) and riscv (i.e. Alexandre) are cc'd on changes to the common code. Otherwise, it's going to be a step backwards in terms of maintainability. Could we add something to MAINTAINERS so that the new file picks you both up as reviewers? Will