A test program, along with a test kernel module, can be found at: https://people.freebsd.org/~luporl/sptest
(The Makefile assumes host is an amd64 machine with a cross powerpc64 toolchain installed, although it should be easy to port it build natively)
With the compiled program and module at current directory, running `./test all` runs all test cases, that exercises most superpage operations, such as:
- promotion
- demotion
- enter
- removal
- unwire
- protect
- etc
The test program should be run in single user mode, to avoid interference from other processes.
Also, most test cases expect a file called "mmap" in the current directory, with a size of exactly 16MB.
To create it, run `dd if=/dev/zero of=mmap bs=1m count=16`.
Besides the test program, `stress` was used to simulate high memory usage, exercise swap and better test SP REF/CHG bits handling.
The tests above were run both on a QEMU VM, with KVM enabled, and also directly on a POWER8 machine.
Finally, buildworld was run with superpages enabled (results above) and no stabilty issues were noticed.