lkml.org 
[lkml]   [2014]   [Nov]   [11]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH v8 10/13] xen/arm/arm64: introduce xen_arch_need_swiotlb
On Mon, 10 Nov 2014, Catalin Marinas wrote:
> On Mon, Nov 10, 2014 at 04:14:02PM +0000, Stefano Stabellini wrote:
> > --- a/arch/arm/include/asm/xen/page.h
> > +++ b/arch/arm/include/asm/xen/page.h
> > @@ -107,4 +107,8 @@ static inline bool set_phys_to_machine(unsigned long pfn, unsigned long mfn)
> > #define xen_remap(cookie, size) ioremap_cache((cookie), (size))
> > #define xen_unmap(cookie) iounmap((cookie))
> >
> > +bool xen_arch_need_swiotlb(struct device *dev,
> > + unsigned long pfn,
> > + unsigned long mfn);
> > +
> > #endif /* _ASM_ARM_XEN_PAGE_H */
> > diff --git a/arch/arm/xen/mm.c b/arch/arm/xen/mm.c
> > index 0e96023..1b087cd 100644
> > --- a/arch/arm/xen/mm.c
> > +++ b/arch/arm/xen/mm.c
> > @@ -102,6 +102,13 @@ void __xen_dma_sync_single_for_device(struct device *hwdev,
> > __xen_dma_page_cpu_to_dev(hwdev, handle, size, dir);
> > }
> >
> > +bool xen_arch_need_swiotlb(struct device *dev,
> > + unsigned long pfn,
> > + unsigned long mfn)
> > +{
> > + return ((pfn != mfn) && !is_device_dma_coherent(dev));
> > +}
>
> Why not a static inline? It doesn't look like a big function.

Because the next patch is going to make this change:

- return ((pfn != mfn) && !is_device_dma_coherent(dev));
+ return (!hypercall_cflush && (pfn != mfn) && !is_device_dma_coherent(dev));

and I think it makes sense to keep hypercall_cflush as a static variable
within arch/arm/xen/mm.c (avoid exporting it in page.h).


\
 
 \ /
  Last update: 2014-11-11 13:41    [W:0.088 / U:1.188 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site