On 11 January 2015 at 13:33, Christoffer Dall <christoffer.dall@xxxxxxxxxx> wrote: > Hi Ard and Marc, > > In KVM/ARM we are currently still checking kvm_is_device_pfn() in > user_mem_abort(). But after Ard's commit (8eef912 arm/arm64: KVM: map > MMIO regions at creation time), shouldn't we always create these > mappings at memregion creation time and never fault here? > Good question. My patch only ensures that VM_PFNMAP regions are stage2 mapped right away, i.e., host mappings made via remap_pfn_range() I wonder if there are other valid cases where a pfn without an associated struct page could be part of a region that is exposed to the guest by the host as a memslot. Perhaps we should wait for the device passthrough stuff etc to materialize before adding BUG()s like this? -- Ard. > In other words, should we do something like this: > > diff --git a/arch/arm/kvm/mmu.c b/arch/arm/kvm/mmu.c > index 1dc9778..4c67b790 100644 > --- a/arch/arm/kvm/mmu.c > +++ b/arch/arm/kvm/mmu.c > @@ -976,8 +983,7 @@ static int user_mem_abort(struct kvm_vcpu *vcpu, phys_addr_t fault_ipa, > if (is_error_pfn(pfn)) > return -EFAULT; > > - if (kvm_is_device_pfn(pfn)) > - mem_type = PAGE_S2_DEVICE; > + VM_BUG_ON(kvm_is_device_pfn(pfn)); > > spin_lock(&kvm->mmu_lock); > if (mmu_notifier_retry(kvm, mmu_seq)) > > -Christoffer _______________________________________________ kvmarm mailing list kvmarm@xxxxxxxxxxxxxxxxxxxxx https://lists.cs.columbia.edu/mailman/listinfo/kvmarm