From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-pg1-f170.google.com (mail-pg1-f170.google.com [209.85.215.170]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id E14856FB8 for ; Fri, 30 Aug 2024 01:00:33 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.215.170 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1724979635; cv=none; b=VWyWeFmWMtZCEl/gpQK8MfjZrNbUjuC9YzaNJh+AvxGgiR2FqKQDeLvLV8IoT99M7BtzHkl9VBUOtpg8H3iXyUf+vGIP9oE0HBEXFAoQd/QSGaWYPWSJ6y+uUPGOd7pQQ9euBB3hZSmJKbrVBpKYlZegjr/BCtAJCSr01xYSIB4= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1724979635; c=relaxed/simple; bh=JFmFm326geTp2LLoKmoyFRxPiCe1hcFYAQqWCNUoWnQ=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=twHQdwHEiLnvCzvBGdfQjf7irJi+aFzzYW5Ju/wawz0c2HWc9Z3seDUg6zAU4PSfm3EmjW5KSTtKm7NVuMhsjKBBdAl/nmTKdEMVF9QA0lyXO4xD/ki9cbi11BWGiuV4MpZNgTQs4og/Iu28KiAsAdJV5DS0WNMtxmAdCLbue6s= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=rivosinc.com; spf=pass smtp.mailfrom=rivosinc.com; dkim=pass (2048-bit key) header.d=rivosinc-com.20230601.gappssmtp.com header.i=@rivosinc-com.20230601.gappssmtp.com header.b=hSg8uOri; arc=none smtp.client-ip=209.85.215.170 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=rivosinc.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=rivosinc.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=rivosinc-com.20230601.gappssmtp.com header.i=@rivosinc-com.20230601.gappssmtp.com header.b="hSg8uOri" Received: by mail-pg1-f170.google.com with SMTP id 41be03b00d2f7-7cd9e634ea9so898295a12.0 for ; Thu, 29 Aug 2024 18:00:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=rivosinc-com.20230601.gappssmtp.com; s=20230601; t=1724979633; x=1725584433; darn=vger.kernel.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=LS53wxxaShUerh6Nzz4tUD12WQZd3J6t0NqAtqOlEuU=; b=hSg8uOriZEdEuidblwZU9g8DEAcO+1wEMMLRhogmPY3O4CZUHf+cPLvelFeIcPhmj2 Ojguhht/upiAyTOTKONNDQw/CE8s8ZOWzDoSu23qXpOVleVJ72D8qRdB3jzKb0baVN0/ nsLCvKpdiHswu84Ix/QeC1I3i8kf2q1noCaRLPQmZG88fcQnMaqvCwqJ+zIMwjzPASXi 5cwJR9N3wq2yp5QWKiyrB7vrQxqHH8ogqh+Q/y84+PZCfZsC1Vaz59o9hceswv34gC+R 5sQ7kN1gilpy5Brtmqjj0/JnVhpngSfXu8tcb5rTmW/8ebtT4M/cyT/UPi5/fYvyHNiG KB2A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1724979633; x=1725584433; 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=LS53wxxaShUerh6Nzz4tUD12WQZd3J6t0NqAtqOlEuU=; b=JXrajZFzHsFU2fLBbHtcmfeoP7+sdVfLg2T5Oyljema/CPUpSlb4QtlxZfW4tRk590 /xAUL1iU/opMej5+k+FBhY1JVvHKNE+J3dXtB97MTo0SF/o4s10J2BatGOCmdlbHYsT1 y8hH0V7CEQ7SwF232VD7uogxMniTpoz0AM8lEToeN6hHukYXwujcXQS/MzmOzutRPbxF 3iW9IowJpR0sWjUwKZZrc0xHYAiLTBR8NTYyCTjBPTkE1uN3bR2WcSOSpK+Lw//q4aVA A+BifEhmWLYDDLXTO7KiHok4Sp0yfTP/Pg9ZASvFfUhu0+1aXrndWTljTyEUwPdRIj42 OV7Q== X-Forwarded-Encrypted: i=1; AJvYcCWnRWkNyohH8VRnK3vnjk6De4gfwtWyzC0uPp4dFv+b5f/hMNDD8HYaDRFPtnx3wzsKSxp4y12BZXjy@vger.kernel.org X-Gm-Message-State: AOJu0Yxdm2qA6WsqZLdND5dUx90S0wHGvyJPa2jz7tUVNZ1WSPScW5Jl L9NDz3I5GPvrrgNzpcy2pL7LAzm1BrDPafWMIAISeNlqrysRdiWwIYQEfOUT0p0= X-Google-Smtp-Source: AGHT+IHskamnwhuEnVsgXagVygWurPjxZHIPCEOoqvpXtCAUWcyWg3cwyRWbxqEUzrtAK6MXZRChtw== X-Received: by 2002:a17:902:e84a:b0:202:3e32:5d3e with SMTP id d9443c01a7336-2050c3faf20mr48056025ad.36.1724979631231; Thu, 29 Aug 2024 18:00:31 -0700 (PDT) Received: from ghost ([50.145.13.30]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-2051555bf89sm17096775ad.289.2024.08.29.18.00.27 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 29 Aug 2024 18:00:30 -0700 (PDT) Date: Thu, 29 Aug 2024 18:00:25 -0700 From: Charlie Jenkins To: Dave Hansen Cc: Arnd Bergmann , Paul Walmsley , Palmer Dabbelt , Albert Ou , Catalin Marinas , Will Deacon , Michael Ellerman , Nicholas Piggin , Christophe Leroy , Naveen N Rao , Muchun Song , Andrew Morton , "Liam R. Howlett" , Vlastimil Babka , Lorenzo Stoakes , Thomas Gleixner , Ingo Molnar , Borislav Petkov , Dave Hansen , x86@kernel.org, "H. Peter Anvin" , Huacai Chen , WANG Xuerui , Russell King , Thomas Bogendoerfer , "James E.J. Bottomley" , Helge Deller , 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 , Shuah Khan , Alexandre Ghiti , linux-arch@vger.kernel.org, linux-kernel@vger.kernel.org, Palmer Dabbelt , linux-riscv@lists.infradead.org, linux-arm-kernel@lists.infradead.org, linuxppc-dev@lists.ozlabs.org, linux-mm@kvack.org, loongarch@lists.linux.dev, linux-mips@vger.kernel.org, linux-parisc@vger.kernel.org, linux-s390@vger.kernel.org, linux-sh@vger.kernel.org, sparclinux@vger.kernel.org, linux-kselftest@vger.kernel.org Subject: Re: [PATCH 00/16] mm: Introduce MAP_BELOW_HINT Message-ID: References: <20240827-patches-below_hint_mmap-v1-0-46ff2eb9022d@rivosinc.com> <4219f619-4b32-40bc-85b8-cb11d76fde98@intel.com> Precedence: bulk X-Mailing-List: linux-mips@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <4219f619-4b32-40bc-85b8-cb11d76fde98@intel.com> On Thu, Aug 29, 2024 at 09:54:08AM -0700, Dave Hansen wrote: > On 8/28/24 13:15, Charlie Jenkins wrote: > > A way to restrict mmap() to return LAM compliant addresses in an entire > > address space also doesn't have to be mutually exclusive with this flag. > > This flag allows for the greatest degree of control from applications. > > I don't believe there is additionally performance saving that could be > > achieved by having this be on a per address space basis. > > I agree with you in general. The MAP_BELOW_HINT _is_ the most flexible. > But it's also rather complicated. Can you expand upon what you mean by it being complicated? Complicated for the kernel or complicated for a user? > > My _hope_ would be that a per-address-space property could share at > least some infrastructure with what x86/LAM and arm/TBI do to the > address space. Basically put the restrictions in place for purely > software reasons instead of the mostly hardware reasons for LAM/TBI. That is a good point, perhaps that would be a way to hook this into LAM, TBI, and any other architecture's specific address masking feature. - Charlie > > Lorenzo also raised some very valid points about a having a generic > address-restriction ABI. I'm certainly not discounting those concerns. > It's not something that can be done lightly.