@@ -220,7 +220,15 @@ static void run(int object_size)
int main(int argc, char **argv)
{
- run(OBJECT_SIZE);
+ drmtest_subtest_init(argc, argv);
+
+ if (drmtest_run_subtest("normal"))
+ run(OBJECT_SIZE);
+ if (drmtest_run_subtest("no-prefault")) {
+ drmtest_disable_prefault();
+ run(OBJECT_SIZE);
+ drmtest_enable_prefault();
+ }
return 0;
}
@@ -144,6 +144,15 @@ test_read(int fd)
munmap(dst, OBJECT_SIZE);
}
+static void
+run_without_prefault(int fd,
+ void (*func)(int fd))
+{
+ drmtest_disable_prefault();
+ func(fd);
+ drmtest_enable_prefault();
+}
+
int main(int argc, char **argv)
{
int fd;
@@ -160,6 +169,12 @@ int main(int argc, char **argv)
test_write(fd);
if (drmtest_run_subtest("write-gtt"))
test_write_gtt(fd);
+ if (drmtest_run_subtest("read-no-prefault"))
+ run_without_prefault(fd, test_read);
+ if (drmtest_run_subtest("write-no-prefault"))
+ run_without_prefault(fd, test_write);
+ if (drmtest_run_subtest("write-gtt-no-prefault"))
+ run_without_prefault(fd, test_write_gtt);
close(fd);
the reloc, pread, pwrite slow path will be prevented by prefault, these subtests will disable prefault first, then do reloc, pread, pwrite, finally enable prefault. Signed-off-by: Xiong Zhang <xiong.y.zhang@intel.com> --- tests/gem_exec_faulting_reloc.c | 10 +++++++++- tests/gem_mmap_gtt.c | 15 +++++++++++++++ 2 files changed, 24 insertions(+), 1 deletion(-)