aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com>2014-11-04 20:21:13 -0500
committerAlexander Graf <agraf@suse.de>2014-12-15 07:27:23 -0500
commitf6fb9e848c39d65516caf7614fc8e0b28f5301ce (patch)
tree5ca8f476f465e6ab1f848a7e35176c5dd4345a7f
parentb6b612571ebe40fe25239e2dbcb0501f246a5337 (diff)
KVM: PPC: Book3S HV: Add missing HPTE unlock
In kvm_test_clear_dirty(), if we find an invalid HPTE we move on to the next HPTE without unlocking the invalid one. In fact we should never find an invalid and unlocked HPTE in the rmap chain, but for robustness we should unlock it. This adds the missing unlock. Reported-by: Benjamin Herrenschmidt <benh@kernel.crashing.org> Signed-off-by: Aneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com> Signed-off-by: Paul Mackerras <paulus@samba.org> Signed-off-by: Alexander Graf <agraf@suse.de>
-rw-r--r--arch/powerpc/kvm/book3s_64_mmu_hv.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/arch/powerpc/kvm/book3s_64_mmu_hv.c b/arch/powerpc/kvm/book3s_64_mmu_hv.c
index d40770248b6a..41f96c51dfca 100644
--- a/arch/powerpc/kvm/book3s_64_mmu_hv.c
+++ b/arch/powerpc/kvm/book3s_64_mmu_hv.c
@@ -1117,8 +1117,11 @@ static int kvm_test_clear_dirty_npages(struct kvm *kvm, unsigned long *rmapp)
1117 } 1117 }
1118 1118
1119 /* Now check and modify the HPTE */ 1119 /* Now check and modify the HPTE */
1120 if (!(hptep[0] & cpu_to_be64(HPTE_V_VALID))) 1120 if (!(hptep[0] & cpu_to_be64(HPTE_V_VALID))) {
1121 /* unlock and continue */
1122 hptep[0] &= ~cpu_to_be64(HPTE_V_HVLOCK);
1121 continue; 1123 continue;
1124 }
1122 1125
1123 /* need to make it temporarily absent so C is stable */ 1126 /* need to make it temporarily absent so C is stable */
1124 hptep[0] |= cpu_to_be64(HPTE_V_ABSENT); 1127 hptep[0] |= cpu_to_be64(HPTE_V_ABSENT);