From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from fhigh5-smtp.messagingengine.com (fhigh5-smtp.messagingengine.com [103.168.172.156]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id CA1D62746B; Wed, 11 Sep 2024 07:25:30 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=103.168.172.156 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1726039533; cv=none; b=qerDN4Xtf28HvmD93Ed4HJ9DdXVP80bdd9nJqh06cR0cpT3JIAOwTqoAtLo4LW52YMiAHLERo38o+7MriThqz2XXdikYpBBbpMOl4nin8EivgvU3J7VIfLLiz1Cbsvi2lZ26hRmPeMffUVWRQkeIgaLersHbTJmxpAbtlrG74hE= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1726039533; c=relaxed/simple; bh=ETLIKsU+6j3dbE0k0YACQOp91RGJ8e3OeoJa4Cxcffs=; h=MIME-Version:Date:From:To:Message-Id:In-Reply-To:References: Subject:Content-Type; b=KGfzXzjsvo+q3RlAiQmg2omTdGMAQK2s8tn7bWzEr/GoU7xb6W9da2Do5jtvzA1EqLxyy7W5FLSCA1IkJ2X9eWuDc33fxT3Tmjblv7425ypqBXmwij82v5T5XS6RHjmPcyNuJa0LddNxVQx555NWm+9UfTBregbkSzzMEIHq24M= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=arndb.de; spf=pass smtp.mailfrom=arndb.de; dkim=pass (2048-bit key) header.d=arndb.de header.i=@arndb.de header.b=F9rNEoeX; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b=iHb72+mh; arc=none smtp.client-ip=103.168.172.156 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=arndb.de Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=arndb.de Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=arndb.de header.i=@arndb.de header.b="F9rNEoeX"; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b="iHb72+mh" Received: from phl-compute-10.internal (phl-compute-10.phl.internal [10.202.2.50]) by mailfhigh.phl.internal (Postfix) with ESMTP id DDD0C1140240; Wed, 11 Sep 2024 03:25:29 -0400 (EDT) Received: from phl-imap-11 ([10.202.2.101]) by phl-compute-10.internal (MEProxy); Wed, 11 Sep 2024 03:25:29 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=arndb.de; h=cc :content-transfer-encoding:content-type:content-type:date:date :from:from:in-reply-to:in-reply-to:message-id:mime-version :references:reply-to:subject:subject:to:to; s=fm1; t=1726039529; x=1726125929; bh=yCULKLzEw1t/f1sPt/nrm6FrZBRX7uDhUSLEPSMpBQQ=; b= F9rNEoeXKRYFxLjIk6eWo1N3gMclbpeQ4mgz4w/7cs9zcRDxkyX0Agm0WNqgCD2W Z7VyyBFKG6orB8gELxqQHkPsZcor9zgyhSaWnMODwD5IWoNXBCfuTJGnX8SoseKi eZdTmPVJZj29qoghoSOoRCe1AaE/65K57zLJI8b3R6sjqoIkd1qVqWJ1TaT8Hk+/ caAys40jlQbCO53cxkBQpbv8n3T+XSXoiscoHdGG+NlKQd95f2KcMzzTKCCQIKVA PmMIBu478Mygj7KL8uE9ChBcat9bONZcEEsZk5fbfhalKZdLHb9JNlc/ZUUljrPK 7deYeUcezD6jBuhp5knKYw== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:content-type :content-type:date:date:feedback-id:feedback-id:from:from :in-reply-to:in-reply-to:message-id:mime-version:references :reply-to:subject:subject:to:to:x-me-proxy:x-me-proxy :x-me-sender:x-me-sender:x-sasl-enc; s=fm1; t=1726039529; x= 1726125929; bh=yCULKLzEw1t/f1sPt/nrm6FrZBRX7uDhUSLEPSMpBQQ=; b=i Hb72+mhQrasBkqcf21vPbxa4UB9x2/tuvmT6y+NJmJyl2py0sIVynyrlpW9jey9I QJ4QERkexr8fEESdSpc5HnseScjtuuv3ksr8SnTZnXN7Fv3NtghoGaxEKas1BowI 1tAbWOF2iikDni2CUFp49Dox8KhYNKF1uhUzMkO98i6hO8wclK+bKHkwuT6PMGtJ yJuiVLpH+NSq/7upriOuVH7rOiZSG/zUmhOKkEYP4iSxXhjNb8uKrugDYk4N2Do6 V7ekBaAaXpEHA6UcL1+ASGMC45d/AthQxpmT2tux7hrHgGS0DepRcSLxPbdKv9Xk e9T2+zMwzn9LwNSVZT0sg== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeeftddrudejtddguddulecutefuodetggdotefrod ftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpggftfghnshhusghstghrihgsvgdp uffrtefokffrpgfnqfghnecuuegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivg hnthhsucdlqddutddtmdenucfjughrpefoggffhffvkfgjfhfutgfgsehtjeertdertddt necuhfhrohhmpedftehrnhguuceuvghrghhmrghnnhdfuceorghrnhgusegrrhhnuggsrd guvgeqnecuggftrfgrthhtvghrnhephfekledtffefhffghfetteehuefhgfetgefhtdeu feduueeltefghedtjeeifffhnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpe hmrghilhhfrhhomheprghrnhgusegrrhhnuggsrdguvgdpnhgspghrtghpthhtohepuddv pdhmohguvgepshhmthhpohhuthdprhgtphhtthhopehlihhnuhigqdgrlhhphhgrsehvgh gvrhdrkhgvrhhnvghlrdhorhhgpdhrtghpthhtoheplhhinhhugidqrghrtghhsehvghgv rhdrkhgvrhhnvghlrdhorhhgpdhrtghpthhtoheplhhinhhugidqtghskhihsehvghgvrh drkhgvrhhnvghlrdhorhhgpdhrtghpthhtoheplhhinhhugidqkhgvrhhnvghlsehvghgv rhdrkhgvrhhnvghlrdhorhhgpdhrtghpthhtoheplhhinhhugidqkhhsvghlfhhtvghsth esvhhgvghrrdhkvghrnhgvlhdrohhrghdprhgtphhtthhopehlihhnuhigqdhmihhpshes vhhgvghrrdhkvghrnhgvlhdrohhrghdprhgtphhtthhopehlihhnuhigqdhprghrihhstg esvhhgvghrrdhkvghrnhgvlhdrohhrghdprhgtphhtthhopehlihhnuhigqdhsfeeltdes vhhgvghrrdhkvghrnhgvlhdrohhrghdprhgtphhtthhopehlihhnuhigqdhshhesvhhgvg hrrdhkvghrnhgvlhdrohhrgh X-ME-Proxy: Feedback-ID: i56a14606:Fastmail Received: by mailuser.phl.internal (Postfix, from userid 501) id 466A32220072; Wed, 11 Sep 2024 03:25:29 -0400 (EDT) X-Mailer: MessagingEngine.com Webmail Interface Precedence: bulk X-Mailing-List: linux-mips@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Date: Wed, 11 Sep 2024 07:25:08 +0000 From: "Arnd Bergmann" To: "Charlie Jenkins" , "Liam R. Howlett" , "Catalin Marinas" , 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 Message-Id: <8130e50c-01e2-45c3-a516-45f5499311f2@app.fastmail.com> In-Reply-To: References: <20240905-patches-below_hint_mmap-v3-0-3cd5564efbbb@rivosinc.com> <20240905-patches-below_hint_mmap-v3-1-3cd5564efbbb@rivosinc.com> <9fc4746b-8e9d-4a75-b966-e0906187e6b7@app.fastmail.com> Subject: Re: [PATCH RFC v3 1/2] mm: Add personality flag to limit address to 47 bits Content-Type: text/plain Content-Transfer-Encoding: 7bit On Wed, Sep 11, 2024, at 00:45, Charlie Jenkins wrote: > On Tue, Sep 10, 2024 at 03:08:14PM -0400, Liam R. Howlett wrote: > > I responded to Arnd in the other thread, but I am still not convinced > that the solution that x86 and arm64 have selected is the best solution. > The solution of defaulting to 47 bits does allow applications the > ability to get addresses that are below 47 bits. However, due to > differences across architectures it doesn't seem possible to have all > architectures default to the same value. Additionally, this flag will be > able to help users avoid potential bugs where a hint address is passed > that causes upper bits of a VA to be used. > > The other issue I have with this is that if there is not a hint address > specified to be greater than 47 bits on x86, then mmap() may return an > address that is greater than 47-bits. The documentation in > Documentation/arch/x86/x86_64/5level-paging.rst says: > > "If hint address set above 47-bit, but MAP_FIXED is not specified, we try > to look for unmapped area by specified address. If it's already > occupied, we look for unmapped area in *full* address space, rather than > from 47-bit window." This is also in the commit message of b569bab78d8d ("x86/mm: Prepare to expose larger address space to userspace"), which introduced it. However, I don't actually see the fallback to the full address space, instead the actual behavior seems to be the same as arm64. Am I missing something in the x86 implementation, or do we just need to update the documentation? Arnd