Commit 682045d3 authored by Paolo Bonzini's avatar Paolo Bonzini
Browse files

x86: smap: Undo changes at end of check_smap_nowp

This makes it simpler to add more tests in the future.
Signed-off-by: default avatarPaolo Bonzini <>
parent fd0898ba
......@@ -80,6 +80,12 @@ static void check_smap_nowp(void)
report("read from user page with SMAP=1, AC=0, WP=0, PTE.U=1 && PTE.W=0", pf_count == 1 && save == 0x99);
/* Undo changes */
*get_pte(phys_to_virt(read_cr3()), USER_ADDR(test)) |= PTE_WRITE;
write_cr0(read_cr0() | X86_CR0_WP);
int main(int ac, char **av)
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment