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

Re: [Xen-devel] PV audio drivers for Linux



On Tue, 17 Jan 2017, Ughreja, Rakesh A wrote:
> Hi,
> 
> I am trying to develop PV audio drivers and facing one issue to 
> achieve zero copy of the buffers between Front End (DOM1) and 
> Back End (DOM0) drivers.

You might want to take a look at the existing PV sound proposal:

http://marc.info/?l=xen-devel&m=148094319010445


> When the buffer is allocated using __get_free_pages() on the DOM0 
> OS, I am able to grant the access using gnttab_grant_foreign_access() 
> to DOM1 as well as I am able to map it in the DOM1 virtual space 
> using xenbus_map_ring_valloc().
> 
> However the existing audio driver allocates buffer using 
> dma_alloc_coherent(). In that case I am able to grant the access using 
> gnttab_grant_foreign_access() to DOM1 but when I try to map in the 
> DOM1 virtual space using xenbus_map_ring_valloc(), it returns an error.
> 
> [1] Code returns from here.
> 
> 507                         xenbus_dev_fatal(dev, map[i].status,
> 508                                          "mapping in shared page %d from 
> domain %d",
> 509                                          gnt_refs[i], dev->otherend_id);
> 
> gnttab_batch_map(map, i) is unable to map the page, but I am unable to 
> understand why. May be its due to the difference in the way buffers
> are allocated dma_alloc_coherent() vs __get_free_pages().
> 
> Since I don't want to touch existing audio driver, I need to figure out 
> how to map buffer to DOM1 space with dma_alloc_coherent().
> 
> Any pointers would be really helpful. Thank you in advance.

Pages allocated by dma_alloc_coherent can be a bit special. Are you
going through the swiotlb-xen
(drivers/xen/swiotlb-xen.c:xen_swiotlb_alloc_coherent) in Dom0?

I would probably add a few printks to Xen in
xen/common/grant_table.c:do_grant_table_op to understand what is the
error exactly.

_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxx
https://lists.xen.org/xen-devel

 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.