xref: /kvm-unit-tests/x86/access_test.c (revision 22866f1e1dd3a48dbc48c9c559b81eaeeafd57ac)
1 #include "libcflat.h"
2 #include "processor.h"
3 #include "x86/vm.h"
4 #include "access.h"
5 
6 int main(void)
7 {
8     int r;
9 
10     printf("starting test\n\n");
11     r = ac_test_run(PT_LEVEL_PML4);
12 
13     if (this_cpu_has(X86_FEATURE_LA57)) {
14         printf("starting 5-level paging test.\n\n");
15         setup_5level_page_table();
16         r = ac_test_run(PT_LEVEL_PML5);
17     }
18 
19     return r ? 0 : 1;
20 }
21