Page MenuHomeFreeBSD

tests: Add MAP_32BIT flag test
ClosedPublic

Authored by dchagin on Jul 30 2023, 6:30 PM.
Tags
None
Referenced Files
Unknown Object (File)
Sep 29 2024, 8:12 PM
Unknown Object (File)
Sep 27 2024, 8:58 PM
Unknown Object (File)
Sep 27 2024, 1:26 PM
Unknown Object (File)
Sep 24 2024, 8:37 AM
Unknown Object (File)
Sep 24 2024, 3:52 AM
Unknown Object (File)
Sep 18 2024, 2:36 PM
Unknown Object (File)
Sep 18 2024, 5:43 AM
Unknown Object (File)
Sep 18 2024, 3:58 AM
Subscribers

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

I am curious, why don't you code this in pure C with ATF.

tests/sys/vm/mmap_map_32bit_helper.c
8

Not needed for the new files

34
In D41236#939212, @kib wrote:

I am curious, why don't you code this in pure C with ATF.

Mostly for the sake of running the test by hand, anyway the helper is needed

tests/sys/vm/Makefile
14

Need to exclude 32-bit arm too.

tests/sys/vm/mmap_map_32bit_helper.c
15

Maybe add _Static_assert(sizeof(vm_offset_t) >= 8);

35
36
39

It's nice to check for errors from munmap() too.

41
45
46
tests/sys/vm/mmap_map_32bit_test.sh
17
28

Seems ok to me, I left a few more notes. Thanks for adding tests.

tests/sys/vm/Makefile
13

A more general way to write it:

.if ${MACHINE} != "i386" && ${MACHINE} != "arm" && (${MACHINE} != "powerpc" || ${MACHINE_ARCH} != "powerpc")
tests/sys/vm/mmap_map_32bit_helper.c
40
50
This revision is now accepted and ready to land.Jul 31 2023, 7:34 PM
tests/sys/vm/mmap_map_32bit_helper.c
8

You do not need to explicitly include sys/cdefs.h.

36

Shouldn't it be s32 + pagesize > MAP_32BIT_MAX_ADDR? At least to allow easier change to the mapping size.

This revision now requires review to proceed.Aug 1 2023, 3:25 PM
dchagin added inline comments.
tests/sys/vm/mmap_map_32bit_helper.c
36

I agree, thank you

This revision is now accepted and ready to land.Aug 1 2023, 3:59 PM
This revision was automatically updated to reflect the committed changes.
dchagin marked an inline comment as done.