[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] Re: [Xen-devel] [PATCH] xen: add gntdev
On 05/12/12 11:24, Manuel Bouyer wrote: > On Wed, Nov 28, 2012 at 02:19:48PM +0100, Roger Pau Monne wrote: >> This is a basic (and experimental) gntdev implementation for NetBSD. >> >> The gnt device allows usermode applications to map grant references in >> userspace. It is mainly used by Qemu to implement a Xen backend (that >> runs in userspace). >> >> Due to the fact that qemu-upstream is not yet functional in NetBSD, >> the only way to try this gntdev is to use the old qemu >> (qemu-traditional). >> >> Performance is not that bad (given that we are using qemu-traditional >> and running a backend in userspace), the throughput of write >> operations is 64.7 MB/s, while in the Dom0 it is 104.6 MB/s. Regarding >> read operations, the throughput inside the DomU is 76.0 MB/s, while on >> the Dom0 it is 108.8 MB/s. >> >> Patches to libxc and libxl are also comming soon. >> >> [...] >> +map_grant_ref(struct gntmap *map); > > please, prefix all struct, global variables and functions of the > driver with gnt > >> + if (pmap_extract_ma(pmap_kernel(), k_va, &ma) == false) { >> + debug("unable to extract kernel MA"); >> + return EFAULT; >> + } > > Can't you get the pa or ma directly from the grant reference ? > Adding a kernel mapping only to run pmap_extract_ma() on it looks like an > innefficient way of doing it (this will require TLB shootdown IPIs). I think I can get the mfn as a result from the GNTTABOP_map_grant_ref operation, according to http://xenbits.xen.org/docs/unstable/misc/grant-tables.txt it should be the dev_bus_addr field, but I'm not sure how updated that document is (I'm afraid it's not really maintained). I've just found that document now, but it looks like it is possible to update the pfn -> mfn mappings to point to the right mfn, so we might be able to use the regular mmap device handler to perform the mappings. On a different question, does someone know why fileops doesn't implement a mmap handler? > Or maybe GNTTABOP_map_grant_ref could map directly in user space ? GNTTABOP_map_grant_ref has an option that's GNTMAP_application_map, but there's no documentation about how that works, and the Linux code is not trivial to understand (at least for me). _______________________________________________ Xen-devel mailing list Xen-devel@xxxxxxxxxxxxx http://lists.xen.org/xen-devel
|
Lists.xenproject.org is hosted with RackSpace, monitoring our |