[Week 8] Import the Xen grant-table bus_dma(9) handlers from OpenBSD

Pratyush Yadav pratyush at freebsd.org
Mon Jul 9 11:40:27 UTC 2018


Hi,

Last week I went through the Xen blkfront driver code to understand
how it works, and how it uses the grant references. It took me quite
some time because the driver is huge and I was often chasing functions
all over the place.

After that, I started to convert the blkfront driver to use the new
busdma implementation. There are two places where foreign access is
granted:
- xbd_connect() (blkfront.c:1341). Here, access is granted to the
xbd's indirect pages.
- xbd_mksegarray() (blkfront.c:162). This is called from the dma
load callback to the loads in xbd_queue_request() (blkfront.c:301).

xbd_connect() seems simpler so I started with it.

I have managed to update xbd_connect() to use the new busdma
implementation, and now I will start to update xbd_mksegarray().

I also made further improvements to the busdma implementation, like
the ability to pass flags to the grant table allocation methods, and
improved error checking. Also, I fixed an infinite recursion bug.

You can check the code here [0].

I maintain a blog on Blogger where I publish my progress every few
days. Check it out if you want more details on what I'm doing [1].


[0] https://github.com/prati0100/freebsd/tree/busdma_xen_clean
[1] https://pratyushgsoc.blogspot.com/

-- 
Regards,
Pratyush Yadav


More information about the soc-status mailing list