Commit 3b6fff19 authored by Uri Lublin's avatar Uri Lublin Committed by Avi Kivity

KVM: Make mark_page_dirty() work for aliased pages too.

Recommended by Izik Eidus.
Signed-off-by: default avatarUri Lublin <uril@qumranet.com>
Signed-off-by: default avatarAvi Kivity <avi@qumranet.com>
parent 9f1ef3f8
...@@ -796,11 +796,11 @@ int kvm_clear_guest(struct kvm *kvm, gpa_t gpa, unsigned long len) ...@@ -796,11 +796,11 @@ int kvm_clear_guest(struct kvm *kvm, gpa_t gpa, unsigned long len)
} }
EXPORT_SYMBOL_GPL(kvm_clear_guest); EXPORT_SYMBOL_GPL(kvm_clear_guest);
/* WARNING: Does not work on aliased pages. */
void mark_page_dirty(struct kvm *kvm, gfn_t gfn) void mark_page_dirty(struct kvm *kvm, gfn_t gfn)
{ {
struct kvm_memory_slot *memslot; struct kvm_memory_slot *memslot;
gfn = unalias_gfn(kvm, gfn);
memslot = __gfn_to_memslot(kvm, gfn); memslot = __gfn_to_memslot(kvm, gfn);
if (memslot && memslot->dirty_bitmap) { if (memslot && memslot->dirty_bitmap) {
unsigned long rel_gfn = gfn - memslot->base_gfn; unsigned long rel_gfn = gfn - memslot->base_gfn;
......
Markdown is supported
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