Re: [RFC PATCH] KVM: PPC: Book3S HV: add support for page faults in VM_IO|VM_PFNMAP vmas

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Fri, 2018-02-09 at 08:14 +0100, Cédric Le Goater wrote:
> > > @@ -402,8 +450,15 @@ int kvmppc_book3s_radix_page_fault(struct kvm_run *run, struct kvm_vcpu *vcpu,
> > >                  vma = find_vma(current->mm, hva);
> > >                  if (vma && vma->vm_start <= hva && hva < vma->vm_end &&
> > >                      (vma->vm_flags & VM_PFNMAP)) {
> > > -                       pfn = vma->vm_pgoff +
> > > -                               ((hva - vma->vm_start) >> PAGE_SHIFT);
> > > +                       if (vma->vm_flags & (VM_IO | VM_PFNMAP)) {
> > > +                               ret = hva_to_pfn_remapped(vma, hva, writing,
> > > +                                                         &pfn);
> > > +                               if (ret == -EAGAIN)
> > > +                                       return RESUME_GUEST;
> > > +                       } else {
> > > +                               pfn = vma->vm_pgoff +
> > > +                                       ((hva - vma->vm_start) >> PAGE_SHIFT);
> > > +                       }
> > 
> > I don't think the else case is useful. If fact you are checking
> > VM_PFNMAP twice...
> 
> yes. I am not sure what the VM_PFNMAP case does. The code comes 
> from kvmppc_book3s_hv_page_fault() I suppose.

You just need to reproduce the bottom of hva_to_pfn. I don't think
that PFNMAP case in Paul's code is quite right anyway, the generic
code will just go read the PTE which is the right thing to do.

Cheers,
Ben.
--
To unsubscribe from this list: send the line "unsubscribe kvm-ppc" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [KVM Development]     [KVM ARM]     [KVM ia64]     [Linux Virtualization]     [Linux USB Devel]     [Linux Video]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Big List of Linux Books]

  Powered by Linux