[PATCH] KVM: MMU: Implement simple reverse mapping
Keep in each host page frame's page->private a pointer to the shadow pte which maps it. If there are multiple shadow ptes mapping the page, set bit 0 of page->private, and use the rest as a pointer to a linked list of all such mappings. Reverse mappings are needed because we when we cache shadow page tables, we must protect the guest page tables from being modified by the guest, as that would invalidate the cached ptes. Signed-off-by: Avi Kivity <avi@qumranet.com> Acked-by: Ingo Molnar <mingo@elte.hu> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
This commit is contained in:
committed by
Linus Torvalds
parent
399badf315
commit
cd4a4e5374
@@ -638,6 +638,7 @@ raced:
|
||||
| __GFP_ZERO);
|
||||
if (!new.phys_mem[i])
|
||||
goto out_free;
|
||||
new.phys_mem[i]->private = 0;
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user