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 CA1F5C3ABC3 for ; Fri, 9 May 2025 11:09:39 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 92E986B00FB; Fri, 9 May 2025 07:09:37 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 8DDD26B00FC; Fri, 9 May 2025 07:09:37 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 7A4836B00FD; Fri, 9 May 2025 07:09:37 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0011.hostedemail.com [216.40.44.11]) by kanga.kvack.org (Postfix) with ESMTP id 5E17C6B00FB for ; Fri, 9 May 2025 07:09:37 -0400 (EDT) Received: from smtpin05.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay07.hostedemail.com (Postfix) with ESMTP id 861D81606F4 for ; Fri, 9 May 2025 11:09:38 +0000 (UTC) X-FDA: 83423098836.05.829B9BF Received: from mail-ej1-f46.google.com (mail-ej1-f46.google.com [209.85.218.46]) by imf26.hostedemail.com (Postfix) with ESMTP id 5E55414000B for ; Fri, 9 May 2025 11:09:36 +0000 (UTC) Authentication-Results: imf26.hostedemail.com; dkim=pass header.d=rivosinc-com.20230601.gappssmtp.com header.s=20230601 header.b=DUr4clUT; dmarc=none; spf=pass (imf26.hostedemail.com: domain of alexghiti@rivosinc.com designates 209.85.218.46 as permitted sender) smtp.mailfrom=alexghiti@rivosinc.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1746788976; 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:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=IvCseEsNXn2YDR22ofVS1EjuRoUQXxujlI0mWYKfm9A=; b=Zf+BvO0W0N6D9c4xLkECma1YICz0P0sIocz2CCooBMfEMYJBVi0y2iRnZat6JFsX7ixqwa h9Mp7ocSPYsxEDQxD23Jp2cQTo75Uq8c/CZOzsVxsBXn7HhRC2+6+apIVWTr/tLLRDGLbZ gBeGe03Qiq4hvyWq0dDOD/GnJBWc6Jw= ARC-Authentication-Results: i=1; imf26.hostedemail.com; dkim=pass header.d=rivosinc-com.20230601.gappssmtp.com header.s=20230601 header.b=DUr4clUT; dmarc=none; spf=pass (imf26.hostedemail.com: domain of alexghiti@rivosinc.com designates 209.85.218.46 as permitted sender) smtp.mailfrom=alexghiti@rivosinc.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1746788976; a=rsa-sha256; cv=none; b=XwBJpPzrKEudQqcEI/x0fhDQVUwJFaD+/YUgFkqcgPiO39kfR9btdqKgYAeRywxSgq0D5U YO6yp7lVF4+tFJRZV7LdeaAw+aYINC9SyGus0/sqoqCdPHyVQdApe0F9RfkG3sgQeAhRPa jH/WVzWm1MxkdbmXOqcLuzLyQCfznb8= Received: by mail-ej1-f46.google.com with SMTP id a640c23a62f3a-ac2c663a3daso387082466b.2 for ; Fri, 09 May 2025 04:09:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=rivosinc-com.20230601.gappssmtp.com; s=20230601; t=1746788975; x=1747393775; darn=kvack.org; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=IvCseEsNXn2YDR22ofVS1EjuRoUQXxujlI0mWYKfm9A=; b=DUr4clUTdclxEd2WExJu+/gqEnG8gJCGlbxo4GyyTi1xJEQ2AR2StYX8WbbfMyOPuV 19O0wsZ/YyldgPLY9z2F/w/pHSpanfO9MqhlaicoIJBVzJvoSk4WbDefbUx3wyy0C+aS psROW57fmDELp8uDmFN/1wLCW5sEpJgb8A0qR2AwHklJmqggPvsyYH5lNzizKP0Tpraj rYz6E596M+OHEB+RKuF5XqQOZC9Xknfu7f4hRx/c6xWSMPbR+/Rl28y8jZ8srBCP1AF+ USz/XC981zzbY6AUcg70w4RTRkboftY5xOdua60A+ZcuqsN/D+f3mzvoMcJ9J/SnvYjx b6VQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1746788975; x=1747393775; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=IvCseEsNXn2YDR22ofVS1EjuRoUQXxujlI0mWYKfm9A=; b=AZpSyErV1Aytq2efn1gYZROX0QU4X6W2GZO1HKTQirEpTc0MhFX4bPTxzbOztJsc7V xWf+AVwHWVFvCAcTbXwEAjj0LgujypVoWjwjp8oTWlLbgleu/sMRug95OK/8StCXS6xG LLecVy+V38E9lUOruhdNV7rUANi2eMrQcgOnyPsm9K9M5VpsET/TAx6YqfOYk9L4syT+ sPBDZ77xlLESPsan9qDXLPdDm9sNkQxBHU50sCKc+wMX7b2P1UAHxgyCQaWOJ2ZBhAdM C6YZrWYULvD7KPfV7TEFHJ1SNjQENFsunAIsdoRsHnyue65rlOSvfOnsgKfqyHQylWK5 Q4OA== X-Forwarded-Encrypted: i=1; AJvYcCWyAlTD2B73avc8hmRFTkPFn0IryrwsYJ25ImbsDX2nz+kqT/WAaRn9R5BVjBdpcdcnLFmwjaxNsA==@kvack.org X-Gm-Message-State: AOJu0Yz/zNi9G1E40TXxaBF/Qtzy93zusjz0wFDQ07RjIC5t2/J/Xr03 /aZ8pnuobDW6aMF6A1yIyDMHKKINrkU7VTB9hNAD+NO1BlV6iazB2RDn/tOwXGRkIZsuDaYUOLR Be6r3leyibL5++/l5HtqVFt18KC5x6bb6q14UWw== X-Gm-Gg: ASbGncuckT3tCJfwa+bsUcxNudz9EwPUh76Iv8gr6gCOmZS8/rQXt2ErYaeiGAOg07F EpQftn3R22z5pGs1wKuGNjGFGurKq1ARFqwbZjHRDMc2sX3OMajPjkjU8xXnPhF+EDTK+0Y3mik c/VtsU1Mu3RlcEg9XNBHz8qngAvjuEst1VoI2aYLO0FuA9OEzNvnL1OA== X-Google-Smtp-Source: AGHT+IHolmFqWEGC4AyYal+IeZ3IwV5YHOWUsjQ6qySOfZum5CD2COEsMayA91FRo6y4k+ibRc9NvWuirdTrS8RhJ24= X-Received: by 2002:a17:907:724f:b0:acb:5343:e75 with SMTP id a640c23a62f3a-ad2190afc7amr206746066b.34.1746788973864; Fri, 09 May 2025 04:09:33 -0700 (PDT) MIME-Version: 1.0 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> <20250508123046.GA3706@willie-the-truck> In-Reply-To: <20250508123046.GA3706@willie-the-truck> From: Alexandre Ghiti Date: Fri, 9 May 2025 13:09:22 +0200 X-Gm-Features: AX0GCFtetDfDezkP8vUdVhHiVYD6YKsFtOYLD7hY4r0bKx1J-4Tcdfpu2fXv07A Message-ID: Subject: Re: [PATCH v5 0/9] Merge arm64/riscv hugetlbfs contpte support To: Will Deacon , Lorenzo Stoakes Cc: Alexandre Ghiti , Ryan Roberts , 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 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Stat-Signature: bhw67ag85mrabkxb91fip8c54cudrej9 X-Rspamd-Queue-Id: 5E55414000B X-Rspam-User: X-Rspamd-Server: rspam05 X-HE-Tag: 1746788976-147788 X-HE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tSIVqjIPhrUfsTn72q5MLXbGs08kCLxaxWNw3vLE3ZgwOJ7IeuWEaB77d1Br3lqhXSOIKi8HX0gcN3ncniIUszPvIo+RANd4GQX/9PYvYH8+9H5Q4rjcXlvFR7TGh1Q9GYUMWipry5ySAbEQTfwRXTgPCjdUiZPHmcxaNKt1odgNCNlKxDi+34KbleK/5aAQsaNJxhDEbGKJWlw+rfEKFaZkGyCgcXjdWj9549pVUAPb8xbVTUXAGsZeR/yPNF0a+ 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 Will, On Thu, May 8, 2025 at 2:30=E2=80=AFPM Will Deacon wrote: > > 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 shar= e 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 q= uite of few > > > bugs popping up lately; so this would bring more eyes and hopefully h= igher > > > quality in the long run. > > > > > > But in the cons column, we have seen HW errata in similar areas in th= e past and > > > I'm nervous that by hoisting this code to mm, we make it harder to wo= rkaround > > > 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 nevert= heless they > > > are winning out in this case; My opinion is that we should keep the a= rm64 > > > implementations of huge_pte_ (and contpte_ too - I know you have a se= parate > > > series for this) private to arm64. > > > > > > Sorry about that. > > > > > > > The end goal is the support of mTHP using svnapot on riscv, which w= e want soon, > > > > so if that patchset does not gain any traction, I'll just copy/past= e 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 fi= xed > > 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? I'm adding Lorenzo as he is cleaning the mm MAINTAINERS entries. @Lorenzo: should we add a new section "CONTPTE" for this? FYI, hugetlb is the first patchset, I have another patchset to merge THP contpte support [1] as well so the "HUGETLB" section does not seem to be a good fit. [1] https://lore.kernel.org/linux-riscv/20240508191931.46060-1-alexghiti@ri= vosinc.com/ Thanks, Alex > > Will