[PATCH 6/6] tools/testing/vma: add test for vma_flags_test(), vma_desc_test()

Lorenzo Stoakes (Oracle) ljs at kernel.org
Fri Mar 6 02:01:55 AEDT 2026


On Thu, Mar 05, 2026 at 02:52:20PM +0100, David Hildenbrand (Arm) wrote:
> On 3/5/26 11:50, Lorenzo Stoakes (Oracle) wrote:
> > Now we have helpers which test singular VMA flags - vma_flags_test() and
> > vma_desc_test() - add a test to explicitly assert that these behave as
> > expected.
> >
> > Signed-off-by: Lorenzo Stoakes (Oracle) <ljs at kernel.org>
> > ---
> >  tools/testing/vma/tests/vma.c | 36 +++++++++++++++++++++++++++++++++++
> >  1 file changed, 36 insertions(+)
> >
> > diff --git a/tools/testing/vma/tests/vma.c b/tools/testing/vma/tests/vma.c
> > index f031e6dfb474..1aa94dd7e74a 100644
> > --- a/tools/testing/vma/tests/vma.c
> > +++ b/tools/testing/vma/tests/vma.c
> > @@ -159,6 +159,41 @@ static bool test_vma_flags_word(void)
> >  	return true;
> >  }
> >
> > +/* Ensure that vma_flags_test() and friends works correctly. */
> > +static bool test_vma_flags_test(void)
> > +{
> > +	const vma_flags_t flags = mk_vma_flags(VMA_READ_BIT, VMA_WRITE_BIT,
> > +					       VMA_EXEC_BIT, 64, 65);
>
> When already using numbers, I was wondering whether you'd want to stick
> to numbers only here.

Numbers are for flags > 64 bits, we currently don't define any, it's to make
sure everything works at higher bitmap sizes, the tests currently set the bitmap
size to 128 bits.

>
> > +	struct vm_area_desc desc;
>
>
> struct vm_area_desc desc = {
> 	.vma_flags = flags,
> };
>
> ?

Ack can do, fix-patch for Andrew below :)

Cheers, Lorenzo

----8<----


More information about the Linux-erofs mailing list