Skip to content

Commit 0084a61

Browse files
committed
Revert "KVM: PPC: e500: Mark "struct page" dirty in kvmppc_e500_shadow_map()"
This reverts commit 8b92e9c which is commit c9be85dabb376299504e0d391d15662c0edf8273 upstream. It should not have been applied. Link: https://lore.kernel.org/r/CABgObfb5U9zwTQBPkPB=mKu-vMrRspPCm4wfxoQpB+SyAnb5WQ@mail.gmail.com Reported-by: Paolo Bonzini <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
1 parent 20228df commit 0084a61

File tree

1 file changed

+7
-6
lines changed

1 file changed

+7
-6
lines changed

arch/powerpc/kvm/e500_mmu_host.c

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -242,7 +242,7 @@ static inline int tlbe_is_writable(struct kvm_book3e_206_tlb_entry *tlbe)
242242
return tlbe->mas7_3 & (MAS3_SW|MAS3_UW);
243243
}
244244

245-
static inline bool kvmppc_e500_ref_setup(struct tlbe_ref *ref,
245+
static inline void kvmppc_e500_ref_setup(struct tlbe_ref *ref,
246246
struct kvm_book3e_206_tlb_entry *gtlbe,
247247
kvm_pfn_t pfn, unsigned int wimg)
248248
{
@@ -252,7 +252,11 @@ static inline bool kvmppc_e500_ref_setup(struct tlbe_ref *ref,
252252
/* Use guest supplied MAS2_G and MAS2_E */
253253
ref->flags |= (gtlbe->mas2 & MAS2_ATTRIB_MASK) | wimg;
254254

255-
return tlbe_is_writable(gtlbe);
255+
/* Mark the page accessed */
256+
kvm_set_pfn_accessed(pfn);
257+
258+
if (tlbe_is_writable(gtlbe))
259+
kvm_set_pfn_dirty(pfn);
256260
}
257261

258262
static inline void kvmppc_e500_ref_release(struct tlbe_ref *ref)
@@ -333,7 +337,6 @@ static inline int kvmppc_e500_shadow_map(struct kvmppc_vcpu_e500 *vcpu_e500,
333337
unsigned int wimg = 0;
334338
pgd_t *pgdir;
335339
unsigned long flags;
336-
bool writable = false;
337340

338341
/* used to check for invalidations in progress */
339342
mmu_seq = kvm->mmu_invalidate_seq;
@@ -487,9 +490,7 @@ static inline int kvmppc_e500_shadow_map(struct kvmppc_vcpu_e500 *vcpu_e500,
487490
goto out;
488491
}
489492
}
490-
writable = kvmppc_e500_ref_setup(ref, gtlbe, pfn, wimg);
491-
if (writable)
492-
kvm_set_pfn_dirty(pfn);
493+
kvmppc_e500_ref_setup(ref, gtlbe, pfn, wimg);
493494

494495
kvmppc_e500_setup_stlbe(&vcpu_e500->vcpu, gtlbe, tsize,
495496
ref, gvaddr, stlbe);

0 commit comments

Comments
 (0)