Commit 333af1b4 authored by Paolo Bonzini's avatar Paolo Bonzini
Browse files

x86: vm: mark intermediate PTEs as user-accessible

It is pointless to make the leaf user-accessible if the intermediate page
tables are not.  In a real OS, what would matter is that the page tables
themselves are only accessible through a supervisor mapping.

The SMAP testcase will rely on the user bit, so fix it now.

Signed-off-by: default avatarPaolo Bonzini <>
parent 21ae5957
......@@ -73,7 +73,7 @@ void install_pte(unsigned long *cr3,
pt_page = 0;
memset(new_pt, 0, PAGE_SIZE);
pt[offset] = virt_to_phys(new_pt) | PTE_PRESENT | PTE_WRITE;
pt[offset] = virt_to_phys(new_pt) | PTE_PRESENT | PTE_WRITE | PTE_USER;
pt = phys_to_virt(pt[offset] & 0xffffffffff000ull);
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