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 lists.ozlabs.org (lists.ozlabs.org [112.213.38.117]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 87A4F103E18F for ; Wed, 18 Mar 2026 14:41:03 +0000 (UTC) Received: from boromir.ozlabs.org (localhost [127.0.0.1]) by lists.ozlabs.org (Postfix) with ESMTP id 4fbWjB1Zfvz2yjV; Thu, 19 Mar 2026 01:41:02 +1100 (AEDT) Authentication-Results: lists.ozlabs.org; arc=none smtp.remote-ip="2600:3c0a:e001:78e:0:1991:8:25" ARC-Seal: i=1; a=rsa-sha256; d=lists.ozlabs.org; s=201707; t=1773844862; cv=none; b=gTB8bOrPl8KgOIc/+IU18ZNBDI1lSpkU4aKtWhCCP3hho8ImbjXHSw5skn/owpj1DYV/kq/pN771B78gD9+maxQb3aD8cbhkJ2052XcYzMG9LW9SBu7BURWdsJS0Di2gdW7UdIKRZFDhsnNKt9nM+heuuvU2QzDdf8P771MTXoTUj6+YOTL/51GWjKVTHojzma5uJK9VKiNGkqcy7KFVqIljxiudOsfQQFuxEBmoQCHjIUxaJXQM1W1DXpUWOjVFat77t+AWT6sWmcB/GrrI4437bj2olZLaaVs8WzXQtM7TV+6M207AkV+OIUvk0jrTRQS/z2LaPM6/P8QI0vFsHA== ARC-Message-Signature: i=1; a=rsa-sha256; d=lists.ozlabs.org; s=201707; t=1773844862; c=relaxed/relaxed; bh=f6SQBnbLtk/tDiFJtuG2lyke9l9pURsRfwk7gcmlJ5k=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=oSgmeXor8JP9rA4wON5tm4FqXaDReTFKZdgJV5In5Xu+8BCx/otX7z6aO1aFKQ/lqg9rxnLISBZ/aWaHPl7V6iibmSTIL7XliY2qKzUJktjR+/Ej6RvkS7eYEr51/mCwE8mUFAqfYTEt3SuQ/KhopNUdxp8mnRzQlctO3Pfthjjg3QjdyAyeZzPIDRA/FiCI80S0CittOQtWxTLN7B6LLHwoDAwgEltTfIg/5MbTWCA0JgHzVlEpj3fvSwtBsvTLN1ST1vMUh+iwf+Je+Jd5DqNLlQvAyxrONkUVjRGllJRXM2ZMPNatut0ktsxu3nWKSMirfA0bWhmS3LIR2s405g== ARC-Authentication-Results: i=1; lists.ozlabs.org; dmarc=pass (p=quarantine dis=none) header.from=kernel.org; dkim=pass (2048-bit key; unprotected) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20201202 header.b=ngbdPPAx; dkim-atps=neutral; spf=pass (client-ip=2600:3c0a:e001:78e:0:1991:8:25; helo=sea.source.kernel.org; envelope-from=vbabka@kernel.org; receiver=lists.ozlabs.org) smtp.mailfrom=kernel.org Authentication-Results: lists.ozlabs.org; dmarc=pass (p=quarantine dis=none) header.from=kernel.org Authentication-Results: lists.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20201202 header.b=ngbdPPAx; dkim-atps=neutral Authentication-Results: lists.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=kernel.org (client-ip=2600:3c0a:e001:78e:0:1991:8:25; helo=sea.source.kernel.org; envelope-from=vbabka@kernel.org; receiver=lists.ozlabs.org) Received: from sea.source.kernel.org (sea.source.kernel.org [IPv6:2600:3c0a:e001:78e:0:1991:8:25]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange x25519) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 4fbWj91vFRz2ygd for ; Thu, 19 Mar 2026 01:41:01 +1100 (AEDT) Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by sea.source.kernel.org (Postfix) with ESMTP id 773FE432F4; Wed, 18 Mar 2026 14:40:58 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 00F29C2BC87; Wed, 18 Mar 2026 14:40:46 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1773844858; bh=QPe6wXvdAXZ1WsVrzW/I1Ea8rZgbDN6tCubJm34Z2So=; h=Date:Subject:To:Cc:References:From:In-Reply-To:From; b=ngbdPPAxWjFSAiZvMouaeaCI+yNsZe/5Ks8XfwK23bbuJ+JwMl7yKx8wLk1AN3mNT TMgJMbhcekeQl6cZDmfGyt8APhVYsofGCMvUz7w5d4VSUqCEDHmA0FWwHmr908obc6 Ca6I5aFuRQUI1yi4z3tpGvtErfL8rr5nKPdU3xQY3LcDhPRgWknRM3aO06irdxNWBm 2TlgtJ0ipwGbJWHORKvyo/BwbM/qZgR2EjBk9w3ApuIqc+XrUbVpU21pCoE11NYSNq L1oljmENCVJ0s9YwPt8FVfCFDTEwjEsGgigo721LFalxDK0WN06IRwXdh82jFvxUSk UiZTvvvmHDYJQ== Message-ID: <4620167c-bcfe-414b-85f6-a5d28563b9af@kernel.org> Date: Wed, 18 Mar 2026 15:40:45 +0100 X-Mailing-List: linuxppc-dev@lists.ozlabs.org List-Id: List-Help: List-Owner: List-Post: List-Archive: , List-Subscribe: , , List-Unsubscribe: Precedence: list MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH v2 01/23] mm/vma: add vma_flags_empty(), vma_flags_and(), vma_flags_diff_pair() 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/16/26 14:07, Lorenzo Stoakes (Oracle) wrote: > Firstly, add the ability to determine if VMA flags are empty, that is no > flags are set in a vma_flags_t value. > > Next, add the ability to obtain the equivalent of the bitwise and of two > vma_flags_t values, via vma_flags_and(). Nit: "two values" is vma_flags_and_mask(), while vma_flags_and() takes one value and list of flags, no? > Next, add the ability to obtain the difference between two sets of VMA > flags, that is the equivalent to the exclusive bitwise OR of the two sets > of flags, via vma_flags_diff_pair(). > > vma_flags_xxx_mask() typically operates on a pointer to a vma_flags_t > value, which is assumed to be an lvalue of some kind (such as a field in a > struct or a stack variable) and an rvalue of some kind (typically a > constant set of VMA flags obtained e.g. via mk_vma_flags() or equivalent). > > However vma_flags_diff_pair() is intended to operate on two lvalues, so use > the _pair() suffix to make this clear. > > Finally, update VMA userland tests to add these helpers. > > We also port bitmap_xor() and __bitmap_xor() to the tools/ headers and > source to allow the tests to work with vma_flags_diff_pair(). > > Signed-off-by: Lorenzo Stoakes (Oracle) Acked-by: Vlastimil Babka (SUSE)