Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1621923

Re: "Consolidate get_dma_ops" breaks Xen on ARM

From Catalin Marinas <catalin.marinas@arm.com>
Newsgroups linux.kernel
Subject Re: "Consolidate get_dma_ops" breaks Xen on ARM
Date 2017-04-12 10:40 +0200
Message-ID <tvlYJ-2ed-1@gated-at.bofh.it> (permalink)
References <tuS0F-88h-3@gated-at.bofh.it> <tuSDn-ah-9@gated-at.bofh.it> <tv3p8-73W-25@gated-at.bofh.it> <tv4bv-7C6-15@gated-at.bofh.it> <tvdya-5fl-13@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


On Tue, Apr 11, 2017 at 04:39:09PM -0700, Stefano Stabellini wrote:
> On Tue, 11 Apr 2017, Catalin Marinas wrote:
> > On Tue, Apr 11, 2017 at 01:43:28PM +0100, Julien Grall wrote:
> > > On 11/04/17 02:14, Bart Van Assche wrote:
> > > > On 04/10/17 17:31, Stefano Stabellini wrote:
> > > >> I think the reason is that, as you can see, if (dev && dev->dma_ops),
> > > >> dev->dma_ops is returned, while before this changes, xen_dma_ops was
> > > >> returned on Xen on ARM.
> > > >>
> > > >> Unfortunately DMA cannot work properly without using the appropriate
> > > >> xen_dma_ops. See drivers/xen/swiotlb-xen.c and arch/arm/xen/mm.c for
> > > >> more details. (The problem is easy to spot, but I wasn't CC'ed on the
> > > >> patch.)
> > > >>
> > > >> I don't know how to solve this problem without introducing some sort of
> > > >> if (xen()) in include/linux/dma-mapping.h.
> > > > 
> > > > Sorry but I don't have access to an ARM development system. Does your 
> > > > comment apply to dev == NULL only, dev != NULL only or perhaps to both? 
> > > > If your comment applies to dev != NULL only, can you check whether 
> > > > adding something like set_dma_ops(dev, get_arch_dma_ops(NULL)) to the 
> > > > appropriate ARM arch_setup_dma_ops() function is sufficient?
> > > 
> > > If I understand correctly, set_dma_ops will replace dev->dma_ops with
> > > Xen DMA ops.
[...]
> > Yet another way would be for dom0 to always set dev->dma_ops to
> > xen_dma_ops and preserve the real dma_ops somewhere under dev->archdata.
> > You could intercept the arch_setup_dma_ops() function for this or use
> > bus_register_notifier() (though I think the former is easier). The Xen
> > code making use of the real dma_ops would have to dig them out from
> > dev->archdata.
> 
> This is a good suggestion, Catalin. Thank you. See below. Is that what
> you have in mind? Julien could you test it, please? If it is the right
> approach, I'll submit the patch properly and rename __generic_dma_ops to
> xen_generic_dma_ops or something.

It looks fine to me (subject to testing successfully).

-- 
Catalin

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

"Consolidate get_dma_ops" breaks Xen on ARM Stefano Stabellini <sstabellini@kernel.org> - 2017-04-11 02:40 +0200
  Re: "Consolidate get_dma_ops" breaks Xen on ARM Bart Van Assche <Bart.VanAssche@sandisk.com> - 2017-04-11 03:20 +0200
    Re: "Consolidate get_dma_ops" breaks Xen on ARM Julien Grall <julien.grall@arm.com> - 2017-04-11 14:50 +0200
      Re: "Consolidate get_dma_ops" breaks Xen on ARM Catalin Marinas <catalin.marinas@arm.com> - 2017-04-11 15:40 +0200
        Re: "Consolidate get_dma_ops" breaks Xen on ARM Stefano Stabellini <sstabellini@kernel.org> - 2017-04-12 01:40 +0200
          Re: "Consolidate get_dma_ops" breaks Xen on ARM Catalin Marinas <catalin.marinas@arm.com> - 2017-04-12 10:40 +0200
          Re: "Consolidate get_dma_ops" breaks Xen on ARM Julien Grall <julien.grall@arm.com> - 2017-04-13 16:10 +0200
            Re: "Consolidate get_dma_ops" breaks Xen on ARM Stefano Stabellini <sstabellini@kernel.org> - 2017-04-13 20:10 +0200

csiph-web