Page MenuHomeFreeBSD

tests: Add MAP_32BIT flag test
ClosedPublic

Authored by dchagin on Jul 30 2023, 6:30 PM.
Tags
None
Referenced Files
F168998584: D41236.id125421.diff
Mon, Aug 31, 2:31 AM
F168995051: D41236.id125349.diff
Mon, Aug 31, 2:20 AM
F168983524: D41236.id125382.diff
Mon, Aug 31, 1:29 AM
F168982808: D41236.id125340.diff
Mon, Aug 31, 1:26 AM
F168961972: D41236.id.diff
Sun, Aug 30, 11:35 PM
F168947953: D41236.id125450.diff
Sun, Aug 30, 10:03 PM
F168942758: D41236.diff
Sun, Aug 30, 9:18 PM
Unknown Object (File)
Sat, Aug 22, 10:02 AM
Subscribers

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Passed
Unit
No Test Coverage
Build Status
Buildable 52925
Build 49816: arc lint + arc unit

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.