aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/kvm/mmu.c
diff options
context:
space:
mode:
Diffstat (limited to 'arch/arm/kvm/mmu.c')
-rw-r--r--arch/arm/kvm/mmu.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/arch/arm/kvm/mmu.c b/arch/arm/kvm/mmu.c
index 57a403a5c22b..8664ff17cbbe 100644
--- a/arch/arm/kvm/mmu.c
+++ b/arch/arm/kvm/mmu.c
@@ -197,7 +197,8 @@ static void unmap_range(struct kvm *kvm, pgd_t *pgdp,
197 pgd = pgdp + pgd_index(addr); 197 pgd = pgdp + pgd_index(addr);
198 do { 198 do {
199 next = kvm_pgd_addr_end(addr, end); 199 next = kvm_pgd_addr_end(addr, end);
200 unmap_puds(kvm, pgd, addr, next); 200 if (!pgd_none(*pgd))
201 unmap_puds(kvm, pgd, addr, next);
201 } while (pgd++, addr = next, addr != end); 202 } while (pgd++, addr = next, addr != end);
202} 203}
203 204
@@ -834,6 +835,11 @@ static bool kvm_is_write_fault(struct kvm_vcpu *vcpu)
834 return kvm_vcpu_dabt_iswrite(vcpu); 835 return kvm_vcpu_dabt_iswrite(vcpu);
835} 836}
836 837
838static bool kvm_is_device_pfn(unsigned long pfn)
839{
840 return !pfn_valid(pfn);
841}
842
837static int user_mem_abort(struct kvm_vcpu *vcpu, phys_addr_t fault_ipa, 843static int user_mem_abort(struct kvm_vcpu *vcpu, phys_addr_t fault_ipa,
838 struct kvm_memory_slot *memslot, unsigned long hva, 844 struct kvm_memory_slot *memslot, unsigned long hva,
839 unsigned long fault_status) 845 unsigned long fault_status)
@@ -904,7 +910,7 @@ static int user_mem_abort(struct kvm_vcpu *vcpu, phys_addr_t fault_ipa,
904 if (is_error_pfn(pfn)) 910 if (is_error_pfn(pfn))
905 return -EFAULT; 911 return -EFAULT;
906 912
907 if (kvm_is_mmio_pfn(pfn)) 913 if (kvm_is_device_pfn(pfn))
908 mem_type = PAGE_S2_DEVICE; 914 mem_type = PAGE_S2_DEVICE;
909 915
910 spin_lock(&kvm->mmu_lock); 916 spin_lock(&kvm->mmu_lock);