KVM: MMU: fix dirty bit setting when removing write permissions
authorIzik Eidus <izike@qumranet.com>
Thu, 20 Mar 2008 16:17:24 +0000 (18:17 +0200)
committerAvi Kivity <avi@qumranet.com>
Sun, 27 Apr 2008 09:00:34 +0000 (12:00 +0300)
commit855149aaa90016c576a0e684361a34f8047307d0
treebfca7a0e52e4a4e7857a2e9fc0ff9f98e9f26dfa
parent69a9f69bb24d6d3dbf3d2ba542ddceeda40536d5
KVM: MMU: fix dirty bit setting when removing write permissions

When mmu_set_spte() checks if a page related to spte should be release as
dirty or clean, it check if the shadow pte was writeble, but in case
rmap_write_protect() is called called it is possible for shadow ptes that were
writeble to become readonly and therefor mmu_set_spte will release the pages
as clean.

This patch fix this issue by marking the page as dirty inside
rmap_write_protect().

Signed-off-by: Izik Eidus <izike@qumranet.com>
Signed-off-by: Avi Kivity <avi@qumranet.com>
arch/x86/kvm/mmu.c