fixing dirty bit setting for calls of rmap_write_protect
PATCH 1/1 fixing dirty bit setting for calls of rmap_write_protect
Signature · 2 lines
-- woof.
Quoted 1 line
From
8a849eb0cedacb384676aa7416e8997d89fe9b0fMon Sep 17 00:00:00 2001
From: Izik Eidus <[email protected]>
Date: Tue, 12 Feb 2008 17:56:43 +0200
Subject: [PATCH] KVM: mmu: fixing dirty bit setting for calls of rmap_write_protect
when mmu_set_spte is checking 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 get called it is possible for shadow ptes that were writeble to become readonly and therefor mmu_set_spte will release the pages of the sptes as clean and not as dirty.
this patch fix this issue by marking the page as dirty inside rmap_write_protect
--- arch/x86/kvm/mmu.c | 8 +++++++- 1 files changed, 7 insertions(+), 1 deletions(-)
arch/x86/kvm/mmu.c +7 -1
@@ -520,8 +520,14 @@ static void rmap_write_protect(struct kvm *kvm, u64 gfn) } spte =rmap_next (kvm, rmapp, spte); } -if (write_protected) +if (write_protected) { +struct page *page; + + spte =rmap_next (kvm, rmapp,NULL ); + page =pfn_to_page ((*spte &PT64_BASE_ADDR_MASK ) >>PAGE_SHIFT ); +SetPageDirty (page);kvm_flush_remote_tlbs (kvm); + } }#ifdef MMU_DEBUG
Signature · 1 line
1.5.3.6
-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
kvm-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/kvm-devel