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 D842AFC6172 for ; Fri, 13 Sep 2024 20:15:46 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 26DFA8D0005; Fri, 13 Sep 2024 16:15:46 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 21D7C8D0003; Fri, 13 Sep 2024 16:15:46 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 070BB8D0005; Fri, 13 Sep 2024 16:15:46 -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 DB9198D0003 for ; Fri, 13 Sep 2024 16:15:45 -0400 (EDT) Received: from smtpin04.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay07.hostedemail.com (Postfix) with ESMTP id 8B58E160879 for ; Fri, 13 Sep 2024 20:15:45 +0000 (UTC) X-FDA: 82560820650.04.D1BE3F6 Received: from mail-pl1-f174.google.com (mail-pl1-f174.google.com [209.85.214.174]) by imf26.hostedemail.com (Postfix) with ESMTP id 71392140002 for ; Fri, 13 Sep 2024 20:15:43 +0000 (UTC) Authentication-Results: imf26.hostedemail.com; dkim=pass header.d=rivosinc-com.20230601.gappssmtp.com header.s=20230601 header.b=qKhPhg6Q; dmarc=none; spf=pass (imf26.hostedemail.com: domain of charlie@rivosinc.com designates 209.85.214.174 as permitted sender) smtp.mailfrom=charlie@rivosinc.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1726258457; a=rsa-sha256; cv=none; b=6GYk4OuOwEajTFXpZryiPuFXBGRl9eYKU1PF/Hp997qWyOBW2MI1fEPkZxrkVfqS4n4nGD XUxwEV/AUOkY4ZsYV1ByNfcDPBwSJmNSAnjVA5dwCNYwJU3Jzzv+1trY4k4d2RAO4XEYoy 7pfRIifUzjaKYcrTdAqD9X58n+AGbv8= ARC-Authentication-Results: i=1; imf26.hostedemail.com; dkim=pass header.d=rivosinc-com.20230601.gappssmtp.com header.s=20230601 header.b=qKhPhg6Q; dmarc=none; spf=pass (imf26.hostedemail.com: domain of charlie@rivosinc.com designates 209.85.214.174 as permitted sender) smtp.mailfrom=charlie@rivosinc.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1726258457; 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=w1FIyAVC28uVndIDT9MHoNGdB/uDnM+DRyhrjJeTBk0=; b=PYmgiZ0+xYFkm7H+kgc/i0qZozFWRLLB3oPjfu6S+OfBfzA6nHy/jObygCD4FZs6JBPM1n EUwFfziKvS5oVUGV4wPBhWliNHmB9xlyNowlTNAox+Jt1EVFQow4ol0v+k/uLtWnJ0XXCv p1Wga4Kj3r39CQDDpRc3bRJzVjQ58zM= Received: by mail-pl1-f174.google.com with SMTP id d9443c01a7336-2068a7c9286so14624395ad.1 for ; Fri, 13 Sep 2024 13:15:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=rivosinc-com.20230601.gappssmtp.com; s=20230601; t=1726258542; x=1726863342; darn=kvack.org; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=w1FIyAVC28uVndIDT9MHoNGdB/uDnM+DRyhrjJeTBk0=; b=qKhPhg6Q/+/ExHbf/bFv1VwWvpgclyCPkkM5ox+2RZygT/Dk8J0PNopp0xJCKpnyWS gvOZeIjotwdicxoPbr4vgAp0PHqUXx7ydI4/LNwX9fcIpoRbxP68gsFUAjiJRD/V4+Y6 3U6ZT/4mg4pcZZl2GdEondwupolr/xjh5Z0yzE23rNvpSQZokFRNJFDy6Yw4CX1Gff49 KJS079rYUX93ZNbsU5EM8cjUbO1WOTCBNO09qmWOR2RaTdzjAwJ+nfgZOmCzp8w+pTGr 7IIqCVYP6QJOfKYueHa7HGmQqpTJaGRtLvG3NXuv7viAMnbwEyEw4XF03pGSh2tJTajH J3ug== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1726258542; x=1726863342; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=w1FIyAVC28uVndIDT9MHoNGdB/uDnM+DRyhrjJeTBk0=; b=efQxlDlAmkc7F3diZXjUi+C8z/YOfQ2kBM1QXk7V085+loXFcXRwn0ANztpCaHgPUZ iDxfVD6GrHAv7X0UTuB0StSi7/KfIbqPrczHXXE+wJqDvD3mdt4RdLK5Yzmaq7VEJ18M p126ix4tV7voVrfZNorBE0eWGL7W2Y0+lSe5U/8SWfhWomzktQY26BGjVHf0MzSzUYX5 hQPApchw60HwUe2dU+pQJPkEj0Vp9ZtWhauk6ONuA9FAikywToEJVPRoJAMKGbrDj18b 0vV9zI0ag6nHduyITMHA9+r+w5VYjRvwEF2HW4CiKGdvTCZ/b2dwAUPqYTDZvnN9Bu4A IQVg== X-Forwarded-Encrypted: i=1; AJvYcCVZGldFwJ4VaLUjxn4huHK31shcmjeu9k02X91gqIHPkqHnbiO2///jAAjmJ+pjfKxdqp1tVquLcQ==@kvack.org X-Gm-Message-State: AOJu0YyRAErr7I+ZQEfK6n6xGX5vSrME4Nu7lvZ1n3D85poNPcAjkbyA MsY2/pRFf04DORqaJnpADU74iDwnrMohsErZ0Wm56I5SAD51njJ42ZNqpVTL+ak= X-Google-Smtp-Source: AGHT+IF+aNQZr3gdahRoQqk9W7f54mB5JjUQKc3RHBzDdb3qrFRnfek72JEtbqkZMIR2o3KSJzgpeA== X-Received: by 2002:a17:902:dad1:b0:205:8407:6321 with SMTP id d9443c01a7336-20781b4740dmr63844425ad.9.1726258541784; Fri, 13 Sep 2024 13:15:41 -0700 (PDT) Received: from ghost ([50.145.13.30]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-207945db10csm315195ad.53.2024.09.13.13.15.37 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 13 Sep 2024 13:15:41 -0700 (PDT) Date: Fri, 13 Sep 2024 13:15:35 -0700 From: Charlie Jenkins To: Catalin Marinas Cc: "Liam R. Howlett" , Arnd Bergmann , guoren , Richard Henderson , Ivan Kokshaysky , Matt Turner , Vineet Gupta , Russell King , Huacai Chen , WANG Xuerui , Thomas Bogendoerfer , "James E . J . Bottomley" , Helge Deller , Michael Ellerman , Nicholas Piggin , Christophe Leroy , Naveen N Rao , Alexander Gordeev , Gerald Schaefer , Heiko Carstens , Vasily Gorbik , Christian Borntraeger , Sven Schnelle , Yoshinori Sato , Rich Felker , John Paul Adrian Glaubitz , "David S . Miller" , Andreas Larsson , Thomas Gleixner , Ingo Molnar , Borislav Petkov , Dave Hansen , x86@kernel.org, "H. Peter Anvin" , Andy Lutomirski , Peter Zijlstra , Muchun Song , Andrew Morton , Vlastimil Babka , Lorenzo Stoakes , shuah , Christoph Hellwig , Michal Hocko , "Kirill A. Shutemov" , Chris Torek , Linux-Arch , linux-kernel@vger.kernel.org, linux-alpha@vger.kernel.org, linux-snps-arc@lists.infradead.org, linux-arm-kernel@lists.infradead.org, "linux-csky@vger.kernel.org" , loongarch@lists.linux.dev, linux-mips@vger.kernel.org, linux-parisc@vger.kernel.org, linuxppc-dev@lists.ozlabs.org, linux-s390@vger.kernel.org, linux-sh@vger.kernel.org, sparclinux@vger.kernel.org, linux-mm@kvack.org, linux-kselftest@vger.kernel.org, linux-abi-devel@lists.sourceforge.net Subject: Re: [PATCH RFC v3 1/2] mm: Add personality flag to limit address to 47 bits Message-ID: References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Rspamd-Server: rspam12 X-Rspamd-Queue-Id: 71392140002 X-Stat-Signature: 83jor4xrc9u4k1k1f71nxkomc3b4th4g X-Rspam-User: X-HE-Tag: 1726258543-780985 X-HE-Meta: U2FsdGVkX19QCQICL0YxzI/UmEqfs/323jeh/jGOcudEmuXdB+5qg6932vBI4SNxJJ2IB3MNH+ZpdRP6dNO54AMKNUipk4qoSOP/py2qN+K7rV91JcPX88WwCQMgNBdIcq7MlfCmQAzUOOBZO4tIzJcYfe/v09rL4IYjXYpX/GzOMUew/0/gq4NE4Nq1F/DVfroseS30GyN3ZczGAAsppc31IdWu/ZYPeS5rUPTAobBkBrJkhIbmDa63dXDCjODjcWr9JFwCkfOvf4PLuJVdDQU8ZmIn/0XWxz+I71Vk/w+cYEUwvhg0W+rh17PP5pODA2lHFTdWdZ+sSXmyEAfX0bUjIyu7loRW1MfG6YTerPiwobYdaQ+yVaHEG6HCqtnsQYZ+L8s2ez+y/5lPurJFXPiEf6owb7NNizXAcWIMVYqcVPgtCid18kpG9OMhkpeejH/MMBYqtJqXpicnntW0jsr+W4lAygkHEXB5H+yybLT0L7/mqUvbG3Da4IoCmDVA0vGqmamJuy52zc1nBLr9Yx9Z5XVQ6iv7f2YGIjENmZraiRMMxzGzyxciz1P7ZM7bsIv8nXEVmbaBtXN+LC7AP4STC/Mbr1ERq90p2YrOSZtQ/otBHTaXn3R0Gi98aypSr0J+NP9x9A/uW2EqGO8kDjw98nKjFvDoqL6OHL85R+sSjzBklBO8o1OjJXZVjLV0xi6oQ4DpnUMWOliBCs71gZUyHbz/KfM1qfuD5EfMePRBAI4YhVUsJOmQeuo9ewVzYN056ifqa4jSuWpMOC8+D+ncO/NW0a8MfChq/YCqu+dDiZtgmzllEveX49SNq8X+G1Ii0ZNcT3RMF870a2PNbpk2q0qYvj8qWodYlusj3Nxle87HkUbugcKmoYZFRShw15rLHFjZl7H9HUeE97OTOGmpw+dEkg5RBvjnLRnQd2P58+TlaNc1ukGrsQUu11T40q9DfCqGwvOrraWs5v0 2Sp6TvHR ZWuirrwVfnyR7QQpuG5cEeUQ+tbna4gkezjPqeu7sCEX0YZ8bMQ61TJeizO6lMuz5ZOJ0Q4lRMIhSt3lWUuQuKf6DdDARfQ3X2jlgzSyxeQHUakSLWQdAETifA3YcUo3BlG9cMeo/k6v3wLoRROBx1hiApIF9mQi3HdD6wj2vpTVt3EPdp5uq1ft+Hi/YeUnbU0/xZ9Ak9ZIqD/SrnN2q9zaXlOhYc3fSbfJPYe8Q3t0MqL8N1n/RcTC6o91vg8+L7CDqYnUX1OGRi2E1E11dF4ble+Z9UrbPV96aqtHrOV3SPrDCYiZu+Z7dQjjwn0bj07VSeBxDUOox4jd5y98A4nDZ7gLsAs7lk6KmxFZP234jqFHbGd8OiXwlzeOQBGz7IMVV8ev3wUpbNZqSmCFh2DYkKYlbS5O61LI87fNz+NkKxZIc7Eay7sz91fFtSVKbnuJfcP7Itjb2mAxCrnaHQGW1J2JBmaKpatV2 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: On Fri, Sep 13, 2024 at 11:08:23AM +0100, Catalin Marinas wrote: > On Thu, Sep 12, 2024 at 02:15:59PM -0700, Charlie Jenkins wrote: > > On Thu, Sep 12, 2024 at 11:53:49AM +0100, Catalin Marinas wrote: > > > On Wed, Sep 11, 2024 at 11:18:12PM -0700, Charlie Jenkins wrote: > > > > Opting-in to the higher address space is reasonable. However, it is not > > > > my preference, because the purpose of this flag is to ensure that > > > > allocations do not exceed 47-bits, so it is a clearer ABI to have the > > > > applications that want this guarantee to be the ones setting the flag, > > > > rather than the applications that want the higher bits setting the flag. > > > > > > Yes, this would be ideal. Unfortunately those applications don't know > > > they need to set a flag in order to work. > > > > It's not a regression, the applications never worked (on platforms that > > do not have this default). The 47-bit default would allow applications > > that didn't work to start working at the cost of a non-ideal ABI. That > > doesn't seem like a reasonable tradeoff to me. If applications want to > > run on new hardware that has different requirements, shouldn't they be > > required to update rather than expect the kernel will solve their > > problems for them? > > That's a valid point but it depends on the application and how much you > want to spend updating user-space. OpenJDK is fine, if you need a JIT > you'll have to add support for that architecture anyway. But others are > arch-agnostic, you just recompile to your target. It's not an ABI > problem, more of an API one. The arch-agnosticism is my hope with this personality flag, it can be added arch-agnostic userspace code and allow the application to work everywhere, but it does have the downside of requiring that change to user-space code. > > The x86 case (and powerpc/arm64) was different, the 47-bit worked for a > long time before expanding it. So it made a lot of sense to keep the > same default. Yes it is very reasonable that this solution was selected for those architectures since the support for higher address spaces evolved in the manner that it did! - Charlie > > Anyway, the prctl() can go both ways, either expanding or limiting the > default address space. So I'd be fine with such interface. > > -- > Catalin