From: Avi Kivity Date: Sat, 6 Jan 2007 00:36:59 +0000 (-0800) Subject: [PATCH] KVM: MMU: Add missing dirty bit X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=760db773fbd0ad2ece89393218c4a4213b5bae6a;p=GitHub%2Fexynos8895%2Fandroid_kernel_samsung_universal8895.git [PATCH] KVM: MMU: Add missing dirty bit If we emulate a write, we fail to set the dirty bit on the guest pte, leading the guest to believe the page is clean, and thus lose data. Bad. Fix by setting the guest pte dirty bit under such conditions. Signed-off-by: Avi Kivity Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- diff --git a/drivers/kvm/paging_tmpl.h b/drivers/kvm/paging_tmpl.h index c894b51ba3f8..2dbf4307ed9e 100644 --- a/drivers/kvm/paging_tmpl.h +++ b/drivers/kvm/paging_tmpl.h @@ -317,6 +317,7 @@ static int FNAME(fix_write_pf)(struct kvm_vcpu *vcpu, } else if (kvm_mmu_lookup_page(vcpu, gfn)) { pgprintk("%s: found shadow page for %lx, marking ro\n", __FUNCTION__, gfn); + *guest_ent |= PT_DIRTY_MASK; *write_pt = 1; return 0; }