Page MenuHomeFreeBSD

tests: Add MAP_32BIT flag test
ClosedPublic

Authored by dchagin on Jul 30 2023, 6:30 PM.
Tags
None
Referenced Files
F132300027: D41236.id125349.diff
Wed, Oct 15, 4:23 PM
F132300025: D41236.id.diff
Wed, Oct 15, 4:23 PM
F132300024: D41236.id125382.diff
Wed, Oct 15, 4:23 PM
F132300022: D41236.id125421.diff
Wed, Oct 15, 4:23 PM
F132300020: D41236.id125450.diff
Wed, Oct 15, 4:23 PM
F132300018: D41236.id125340.diff
Wed, Oct 15, 4:23 PM
F132253477: D41236.diff
Wed, Oct 15, 5:32 AM
Unknown Object (File)
Tue, Sep 30, 3:04 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.