Commit e83213a9 authored by Greg Kroah-Hartman's avatar Greg Kroah-Hartman Committed by Wentao Guan
Browse files

Revert "KVM: PPC: e500: Mark "struct page" dirty in kvmppc_e500_shadow_map()"

stable inclusion
from stable-v6.6.83
commit 03f1b76fcdbc5112eddf077dea7f09616437271d
category: bugfix
bugzilla: https://gitee.com/openeuler/kernel/issues/IBX1M5

Reference: https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?id=03f1b76fcdbc5112eddf077dea7f09616437271d

--------------------------------

This reverts commit 15d60c13b704f770ba45c58477380d4577cebfa3 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: default avatarPaolo Bonzini <pbonzini@redhat.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
(cherry picked from commit 03f1b76fcdbc5112eddf077dea7f09616437271d)
Signed-off-by: default avatarWentao Guan <guanwentao@uniontech.com>
parent bc19bde7
Loading
Loading
Loading
Loading
+7 −6
Original line number Diff line number Diff line
@@ -242,7 +242,7 @@ static inline int tlbe_is_writable(struct kvm_book3e_206_tlb_entry *tlbe)
	return tlbe->mas7_3 & (MAS3_SW|MAS3_UW);
}

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

	return tlbe_is_writable(gtlbe);
	/* Mark the page accessed */
	kvm_set_pfn_accessed(pfn);

	if (tlbe_is_writable(gtlbe))
		kvm_set_pfn_dirty(pfn);
}

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,
	unsigned int wimg = 0;
	pgd_t *pgdir;
	unsigned long flags;
	bool writable = false;

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

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