diff options
author | Paul Mackerras <paulus@samba.org> | 2012-11-19 18:01:34 -0500 |
---|---|---|
committer | Alexander Graf <agraf@suse.de> | 2012-12-05 19:33:53 -0500 |
commit | 4879f241720cda3e6c18a1713bf9b2ed2de14ee4 (patch) | |
tree | 300a9282556b3e441b9747dee4b5e51d440986fe | |
parent | 7ed661bf852cefa1ab57ad709a675bfb029d47ab (diff) |
KVM: PPC: Book3S HV: Fix bug causing loss of page dirty state
This fixes a bug where adding a new guest HPT entry via the H_ENTER
hcall would lose the "changed" bit in the reverse map information
for the guest physical page being mapped. The result was that the
KVM_GET_DIRTY_LOG could return a zero bit for the page even though
the page had been modified by the guest.
This fixes it by only modifying the index and present bits in the
reverse map entry, thus preserving the reference and change bits.
We were also unnecessarily setting the reference bit, and this
fixes that too.
Signed-off-by: Paul Mackerras <paulus@samba.org>
Signed-off-by: Alexander Graf <agraf@suse.de>
-rw-r--r-- | arch/powerpc/kvm/book3s_hv_rm_mmu.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/arch/powerpc/kvm/book3s_hv_rm_mmu.c b/arch/powerpc/kvm/book3s_hv_rm_mmu.c index 362dffe4db10..ff2da5ce475c 100644 --- a/arch/powerpc/kvm/book3s_hv_rm_mmu.c +++ b/arch/powerpc/kvm/book3s_hv_rm_mmu.c | |||
@@ -59,10 +59,10 @@ void kvmppc_add_revmap_chain(struct kvm *kvm, struct revmap_entry *rev, | |||
59 | head->back = pte_index; | 59 | head->back = pte_index; |
60 | } else { | 60 | } else { |
61 | rev->forw = rev->back = pte_index; | 61 | rev->forw = rev->back = pte_index; |
62 | i = pte_index; | 62 | *rmap = (*rmap & ~KVMPPC_RMAP_INDEX) | |
63 | pte_index | KVMPPC_RMAP_PRESENT; | ||
63 | } | 64 | } |
64 | smp_wmb(); | 65 | unlock_rmap(rmap); |
65 | *rmap = i | KVMPPC_RMAP_REFERENCED | KVMPPC_RMAP_PRESENT; /* unlock */ | ||
66 | } | 66 | } |
67 | EXPORT_SYMBOL_GPL(kvmppc_add_revmap_chain); | 67 | EXPORT_SYMBOL_GPL(kvmppc_add_revmap_chain); |
68 | 68 | ||