Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit a9c0e12e authored by Marc Zyngier's avatar Marc Zyngier Committed by Christoffer Dall
Browse files

KVM: arm/arm64: Only clean the dcache on translation fault



The only case where we actually need to perform a dcache maintenance
is when we map the page for the first time, and subsequent permission
faults do not require cache maintenance. Let's make it conditional
on not being a permission fault (and thus a translation fault).

Reviewed-by: default avatarChristoffer Dall <christoffer.dall@linaro.org>
Signed-off-by: default avatarMarc Zyngier <marc.zyngier@arm.com>
Signed-off-by: default avatarChristoffer Dall <christoffer.dall@linaro.org>
parent d0e22b4a
Loading
Loading
Loading
Loading
+6 −2
Original line number Diff line number Diff line
@@ -1400,6 +1400,8 @@ static int user_mem_abort(struct kvm_vcpu *vcpu, phys_addr_t fault_ipa,
			new_pmd = kvm_s2pmd_mkwrite(new_pmd);
			kvm_set_pfn_dirty(pfn);
		}

		if (fault_status != FSC_PERM)
			clean_dcache_guest_page(vcpu, pfn, PMD_SIZE);

		if (exec_fault) {
@@ -1416,6 +1418,8 @@ static int user_mem_abort(struct kvm_vcpu *vcpu, phys_addr_t fault_ipa,
			kvm_set_pfn_dirty(pfn);
			mark_page_dirty(kvm, gfn);
		}

		if (fault_status != FSC_PERM)
			clean_dcache_guest_page(vcpu, pfn, PAGE_SIZE);

		if (exec_fault) {