From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (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 DE2A6390CAA; Fri, 20 Mar 2026 10:51:21 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1774003882; cv=none; b=FECyDNlI5QZ24sWILueJsqKgyjC89rVcYnvxSAezWrPm/6mhETTXqquVpJQwjJxZJxomSR+9ng0u7rioWwvdmQ5p58cEiC2IqnvWr4EU5EORk2FDpayZJkKQtC7WAsdlHxdc7tKvNYhtcbaSJtKrGshcsGXLaPR8j1uoKfrfvY0= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1774003882; c=relaxed/simple; bh=1kycPrv8xITwEF0VVuzOopEOMjAdBs0UtmKgTytYl8w=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=o9HWWp1EEfUtZwoCw32hmfhhXrevfsYuFVRVMhucP8SZ/Mizw0JP29LytgDTReT2rhc4t1hw5N1cmDFv5ODs29VXHkYQVsx3C9X3dH1eDZSiG/2WD1/Ufid5wOdMkHEudJzVq4o4KcCyovjdbU7824PT8BjvkSnmgfZPYovQAoc= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=fvQ6q+Lt; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="fvQ6q+Lt" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 3393BC4CEF7; Fri, 20 Mar 2026 10:51:09 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1774003881; bh=1kycPrv8xITwEF0VVuzOopEOMjAdBs0UtmKgTytYl8w=; h=Date:Subject:To:Cc:References:From:In-Reply-To:From; b=fvQ6q+Lt6csXQ3LFLwYm6cnCeDtBGCr02CIsjl1UXjYlr3fZ8BMsG3AFhxo458ZCa +qYpGTorkZJUoSz2KLgM+8v53n1WJOnltl6z07l5stKzZpUnrWYEz5FYiN3Nd+Jdmh 8SClfiC2LO/qPw7ZNAT9I5oEK8JjSkMNRE+Nrm7ekRgipBjhHQB3OmHjgPWwn3piDZ h9DkUtF/Zkavrff/L+X9y6IoV/GXTCjuHOFy4E/EZLIw/I9GYQQxnoeqCJ4GJE74BD X+Z2q8v5Urpdb/OoxHDRr56qpMqMhQXXZ8oYFfyAhWL2CpRfz05crij8p1GJ5Qo9Ia XZOMGmHBKHSXQ== Message-ID: <077b237c-32ab-46a0-947e-17657cca5b54@kernel.org> Date: Fri, 20 Mar 2026 11:51:08 +0100 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH v3 23/23] mm/vma: convert __mmap_region() to use vma_flags_t Content-Language: en-US To: "Lorenzo Stoakes (Oracle)" , Andrew Morton Cc: David Hildenbrand , "Liam R . Howlett" , Jann Horn , Pedro Falcato , Mike Rapoport , Suren Baghdasaryan , Kees Cook , linux-mm@kvack.org, linux-kernel@vger.kernel.org, Vineet Gupta , Russell King , Catalin Marinas , Will Deacon , Brian Cain , Huacai Chen , WANG Xuerui , Thomas Bogendoerfer , Dinh Nguyen , Madhavan Srinivasan , Michael Ellerman , Nicholas Piggin , Christophe Leroy , Paul Walmsley , Palmer Dabbelt , Albert Ou , Alexandre Ghiti , Heiko Carstens , Vasily Gorbik , Alexander Gordeev , Christian Borntraeger , Sven Schnelle , Thomas Gleixner , Ingo Molnar , Borislav Petkov , Dave Hansen , x86@kernel.org, "H . Peter Anvin" , Richard Weinberger , Anton Ivanov , Johannes Berg , Alexander Viro , Christian Brauner , Jan Kara , Xu Xin , Chengming Zhou , Michal Hocko , Paul Moore , Stephen Smalley , Ondrej Mosnacek , linux-snps-arc@lists.infradead.org, linux-arm-kernel@lists.infradead.org, linux-hexagon@vger.kernel.org, loongarch@lists.linux.dev, linux-mips@vger.kernel.org, linuxppc-dev@lists.ozlabs.org, linux-riscv@lists.infradead.org, linux-s390@vger.kernel.org, linux-um@lists.infradead.org, linux-fsdevel@vger.kernel.org, selinux@vger.kernel.org References: From: "Vlastimil Babka (SUSE)" In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit On 3/18/26 16:50, Lorenzo Stoakes (Oracle) wrote: > Update the mmap() implementation logic implemented in __mmap_region() and > functions invoked by it. The mmap_region() function converts its input > vm_flags_t parameter to a vma_flags_t value which it then passes to > __mmap_region() which uses the vma_flags_t value consistently from then > on. > > As part of the change, we convert map_deny_write_exec() to using > vma_flags_t (it was incorrectly using unsigned long before), and place it > in vma.h, as it is only used internal to mm. > > With this change, we eliminate the legacy is_shared_maywrite_vm_flags() > helper function which is now no longer required. > > We are also able to update the MMAP_STATE() and VMG_MMAP_STATE() macros to > use the vma_flags_t value. > > Finally, we update the VMA tests to reflect the change. > > Signed-off-by: Lorenzo Stoakes (Oracle) Acked-by: Vlastimil Babka (SUSE)