[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [Xen-devel] Re: [PATCH] infiniband/mthca : Fix userland mapping of mthca infiniband cards in Xen dom0
> --- kernel-2.6.32.fc12.orig/drivers/infiniband/hw/mthca/mthca_provider.c > 2010-12-16 16:39:06.901130993 +0100 > +++ kernel-2.6.32.fc12.new/drivers/infiniband/hw/mthca/mthca_provider.c > 2010-12-16 17:02:07.944127489 +0100 > @@ -391,6 +391,8 @@ static int mthca_mmap_uar(struct ib_ucon > if (vma->vm_end - vma->vm_start != PAGE_SIZE) > return -EINVAL; > > + vma->vm_flags |= VM_IO; > + vma->vm_page_prot = vm_get_page_prot(vma->vm_flags); > vma->vm_page_prot = pgprot_noncached(vma->vm_page_prot); > > if (io_remap_pfn_range(vma, vma->vm_start, This is kind of unappealing -- is there no way to make io_remap_pfn_range do the right thing under Xen? It seems unfortunate to make drivers both set VM_IO and call io_remap_pfn_range. Or maybe we should get rid of io_remap_pfn_range() and just have drivers set VM_IO and call remap_pfn_range() all the time? There are quite a few drivers under drivers/infiniband/hw that call io_remap_pfn_range() -- presumably they all need the analogous fix? Finally as a stylistic thing I would probably prefer to see the vm_page_prot manipulation written as vma->vm_page_prot = pgprot_noncached(vm_get_page_prot(vma->vm_flags)); and if this fix is really the right thing to do, this should probably be wrapped up in a helper function; presumably every instance of vma->vm_page_prot = pgprot_FOO(vma->vm_page_prot) under drivers/ would need the same fix for Xen. - R. _______________________________________________ Xen-devel mailing list Xen-devel@xxxxxxxxxxxxxxxxxxx http://lists.xensource.com/xen-devel
|
![]() |
Lists.xenproject.org is hosted with RackSpace, monitoring our |