mirror of
git://git.kernel.org/pub/scm/linux/kernel/git/xiang/erofs.git
synced 2026-11-01 23:04:54 +01:00
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: Christoffer Dall <[email protected]> Signed-off-by: Marc Zyngier <[email protected]> Signed-off-by: Christoffer Dall <[email protected]>
This commit is contained in:
1 parent
d0e22b4ac3
commit
a9c0e12ebe
1 file changed
+6
-2
+6
-2
@@ -1400,7 +1400,9 @@ 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);
|
||||
}
|
||||
clean_dcache_guest_page(vcpu, pfn, PMD_SIZE);
|
||||
|
||||
if (fault_status != FSC_PERM)
|
||||
clean_dcache_guest_page(vcpu, pfn, PMD_SIZE);
|
||||
|
||||
if (exec_fault) {
|
||||
new_pmd = kvm_s2pmd_mkexec(new_pmd);
|
||||
@@ -1416,7 +1418,9 @@ static int user_mem_abort(struct kvm_vcpu *vcpu, phys_addr_t fault_ipa,
|
||||
kvm_set_pfn_dirty(pfn);
|
||||
mark_page_dirty(kvm, gfn);
|
||||
}
|
||||
clean_dcache_guest_page(vcpu, pfn, PAGE_SIZE);
|
||||
|
||||
if (fault_status != FSC_PERM)
|
||||
clean_dcache_guest_page(vcpu, pfn, PAGE_SIZE);
|
||||
|
||||
if (exec_fault) {
|
||||
new_pte = kvm_s2pte_mkexec(new_pte);
|
||||
|
||||
Reference in new issue
Block a user