Commit Graph

11 Commits

Author SHA1 Message Date
Avi Kivity
38443e2c4c posix: change file_desc mmap API to return an mmap_area
An mmap_area munmap()s itself when destroyed, reclaiming memory.
2014-12-11 12:25:31 +02:00
Glauber Costa
a4667c48e6 xen: fix gntalloc for userspace
It broke when we changed things to accomodate OSv's functions. The following
code works.

Signed-off-by: Glauber Costa <glommer@cloudius-systems.com>
2014-11-27 18:00:35 +01:00
Avi Kivity
5bb13601fe xen: wrap in "xen" namespace
Names like "port" are too generic for the global namespace.
2014-11-09 14:41:01 +02:00
Glauber Costa
3d0f2de8bb xen: method to end a grant operation
Signed-off-by: Glauber Costa <glommer@cloudius-systems.com>
2014-11-06 11:21:30 +01:00
Glauber Costa
0a1f5f9e73 xen: defer grant table operations
Instead of returning a reference to a grant that is already present in an
array, defer the initialization. This is how the OSv driver handles it, and I
honestly am not sure if this is really needed: it seems to me we should be able
to just reuse the old grants. I need to check in the backend code if we can be
any smarter than this.

However, right now we need to do something to recycle the buffers, and just
re-doing the refs would lead to inconsistencies. So the best by now is to close
and reopen the grants, and then later on rework this in a way that works for
both the initial setup and the recycle.

Signed-off-by: Glauber Costa <glommer@cloudius-systems.com>
2014-11-06 11:21:30 +01:00
Glauber Costa
ee172e36c1 xen: enhance gntref
Enhance gntref with some useful operations. Also provide a default object that
represents an invalid grant.

Signed-off-by: Glauber Costa <glommer@cloudius-systems.com>
2014-11-06 11:21:29 +01:00
Avi Kivity
2d14053e6e xen: make gntref more readable
Convert it from std::pair with meaningless .first and .second fields to
a proper struct.
2014-11-05 15:09:04 +02:00
Avi Kivity
a769737faa xen: fix another bad grant operation
We used gnttab_grant_foreign_access() instead of
gnttab_grant_foreign_access_ref().  While the two functions have similar
enough signatures, they do very different things.

With the change, we are able to receive packets from Xen, though we crash
immediately.
2014-11-05 15:09:03 +02:00
Avi Kivity
afbe788235 xen: fix bad grant operation
We used gnttab_grant_foreign_access() instead of
gnttab_grant_foreign_access_ref().  While the two functions have similar
enough signatures, they do very different things.

With the change, we are able to transmit packets through Xen.
2014-11-05 15:09:03 +02:00
Avi Kivity
6269fe2bdf xen: fix virt_to_mfn()
Need to shift by 12 to get to a frame number.  With this the host accepts
the guest interface.
2014-11-05 15:09:03 +02:00
Glauber Costa
891b40a2af xen: gntalloc device
This patch creates a seastar enabled version of the xen gntalloc device.

TODO: grow the table dynamically, and fix the index selection algorithm. Shouldn't
just always bump 1.

Signed-off-by: Glauber Costa <glommer@cloudius-systems.com>
2014-11-05 15:09:03 +02:00