39 return xtf_error(
"Error: Update va failed\n");
41 unsigned long map_slot = 0, test_slot = 0;
45 for ( i = 0; i < L4_PT_ENTRIES; ++i )
47 if ( !(l4[i] &
PF_SYM(P)) )
53 for ( ; i < L4_PT_ENTRIES; ++i )
55 if ( !(l4[i] &
PF_SYM(P)) )
62 if ( !map_slot || !test_slot )
63 return xtf_error(
"Insufficient free l4 slots\n");
67 .val = cr3 |
PF_SYM(AD, U, P),
70 printk(
" Creating recursive l4 mapping\n");
78 return xtf_skip(
"Skip: Linear pagetables disallowed\n");
81 return xtf_error(
"Error: Recursive mapping failed: %d\n", rc);
84 printk(
" Remapping l4 RW\n");
88 printk(
" Attempt to create writeable linear map was blocked\n");
98 intpte_t *writeable =
_p(map_slot << L4_PT_SHIFT |
99 map_slot << L3_PT_SHIFT |
103 writeable[test_slot] = 0xdeadf00d;
107 if ( l4[test_slot] == 0xdeadf00d )
109 printk(
" Successfully constructed writeable pagetables\n");
117 writeable[test_slot] = 0;
void test_main(void)
To be implemented by each test, as its entry point.
intpte_t pte_from_paddr(paddr_t paddr, uint64_t flags)