Skip to contentSkip to conversation

libs/gnttab: add missing FreeBSD functions

PATCH In review Roger Pau Monne 4 participants 4 messages Feb 19, 2019 – Feb 20, 2019

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 libs/gnttab: add missing FreeBSD functions

The FreeBSD implementation is missing the following functions:

osdep_gnttab_dmabuf_exp_from_refs
osdep_gnttab_dmabuf_exp_wait_released
osdep_gnttab_dmabuf_imp_to_refs
osdep_gnttab_dmabuf_imp_release

Which all deal with dmabufs, that only exists on Linux. Implement them using abort, since such functions should never be called on FreeBSD.

FTR, I realized those functions where missing when attempting to use pygrub:

Traceback (most recent call last):
File "/usr/local/lib/xen/bin/pygrub", line 19, in <module>
import xen.lowlevel.xc
ImportError: /usr/local/lib/libxengnttab.so.1: Undefined symbol "osdep_gnttab_dmabuf_exp_from_refs"

Fixes ee8105 ("libgnttab: Add support for Linux dma-buf")

---
Cc: Oleksandr Andrushchenko <[email protected]>
Cc: Ian Jackson <[email protected]>
Cc: Wei Liu <[email protected]>

---
 tools/libs/gnttab/freebsd.c | 29 +++++++++++++++++++++++++++++
 1 file changed, 29 insertions(+)
tools/libs/gnttab/freebsd.c +29 -0
index 5c12fe9b0b..886b588303 100644
@@ -307,6 +307,35 @@ int osdep_gntshr_unshare(xengntshr_handle *xgs,
     return munmap(start_address, count * PAGE_SIZE);
 }
 
+/*
+ * The functions below are Linux-isms that will likely never be implemented
+ * on FreeBSD unless FreeBSD also implements something akin to Linux dmabuf.
+ */
+int osdep_gnttab_dmabuf_exp_from_refs(xengnttab_handle *xgt, uint32_t domid,
+                                      uint32_t flags, uint32_t count,
+                                      const uint32_t *refs,
+                                      uint32_t *dmabuf_fd)
+{
+    abort();
+}
+
+int osdep_gnttab_dmabuf_exp_wait_released(xengnttab_handle *xgt,
+                                          uint32_t fd, uint32_t wait_to_ms)
+{
+    abort();
+}
+
+int osdep_gnttab_dmabuf_imp_to_refs(xengnttab_handle *xgt, uint32_t domid,
+                                    uint32_t fd, uint32_t count, uint32_t *refs)
+{
+    abort();
+}
+
+int osdep_gnttab_dmabuf_imp_release(xengnttab_handle *xgt, uint32_t fd)
+{
+    abort();
+}
+
 /*
  * Local variables:
  * mode: C
Signature · 7 lines
2.17.2 (Apple Git-113)


_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xenproject.org/mailman/listinfo/xen-devel
Acked-by on v1 1/1
#1 lore raw
Quoted 18 lines · Roger Pau Monne

The FreeBSD implementation is missing the following functions:

osdep_gnttab_dmabuf_exp_from_refs
osdep_gnttab_dmabuf_exp_wait_released
osdep_gnttab_dmabuf_imp_to_refs
osdep_gnttab_dmabuf_imp_release

Which all deal with dmabufs, that only exists on Linux. Implement them using abort, since such functions should never be called on FreeBSD.

FTR, I realized those functions where missing when attempting to use pygrub:

Traceback (most recent call last):
File "/usr/local/lib/xen/bin/pygrub", line 19, in <module>
import xen.lowlevel.xc
ImportError: /usr/local/lib/libxengnttab.so.1: Undefined symbol "osdep_gnttab_dmabuf_exp_from_refs"

Quoted 6 lines
Fixes ee8105 ("libgnttab: Add support for Linux dma-buf")

---
Cc: Oleksandr Andrushchenko <[email protected]>
Cc: Ian Jackson <[email protected]>
Cc: Wei Liu <[email protected]>

CC Juergen.

_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xenproject.org/mailman/listinfo/xen-devel

#2 lore raw
In reply to Roger Pau Monne
Quoted 13 lines · Roger Pau Monne

The FreeBSD implementation is missing the following functions:

osdep_gnttab_dmabuf_exp_from_refs
osdep_gnttab_dmabuf_exp_wait_released
osdep_gnttab_dmabuf_imp_to_refs
osdep_gnttab_dmabuf_imp_release

Which all deal with dmabufs, that only exists on Linux. Implement them using abort, since such functions should never be called on FreeBSD.

FTR, I realized those functions where missing when attempting to use pygrub:

Quoted 7 lines

Traceback (most recent call last):
File "/usr/local/lib/xen/bin/pygrub", line 19, in <module>
import xen.lowlevel.xc
ImportError: /usr/local/lib/libxengnttab.so.1: Undefined symbol "osdep_gnttab_dmabuf_exp_from_refs"

Fixes ee8105 ("libgnttab: Add support for Linux dma-buf")

Juergen

_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xenproject.org/mailman/listinfo/xen-devel

Reviewed-by on v1 1/1
#3 lore raw
In reply to Roger Pau Monne
Quoted 13 lines · Roger Pau Monne

The FreeBSD implementation is missing the following functions:

osdep_gnttab_dmabuf_exp_from_refs
osdep_gnttab_dmabuf_exp_wait_released
osdep_gnttab_dmabuf_imp_to_refs
osdep_gnttab_dmabuf_imp_release

Which all deal with dmabufs, that only exists on Linux. Implement them using abort, since such functions should never be called on FreeBSD.

FTR, I realized those functions where missing when attempting to use pygrub:

Quoted 7 lines

Traceback (most recent call last):
File "/usr/local/lib/xen/bin/pygrub", line 19, in <module>
import xen.lowlevel.xc
ImportError: /usr/local/lib/libxengnttab.so.1: Undefined symbol "osdep_gnttab_dmabuf_exp_from_refs"

Fixes ee8105 ("libgnttab: Add support for Linux dma-buf")

Indeed, my bad

Quoted 38 lines

---
Cc: Oleksandr Andrushchenko <[email protected]>
Cc: Ian Jackson <[email protected]>
Cc: Wei Liu <[email protected]>

---
  tools/libs/gnttab/freebsd.c | 29 +++++++++++++++++++++++++++++
  1 file changed, 29 insertions(+)
tools/libs/gnttab/freebsd.c +22 -0
index 5c12fe9b0b..886b588303 100644
@@ -307,6 +307,35 @@ int osdep_gntshr_unshare(xengntshr_handle *xgs,
      return munmap(start_address, count * PAGE_SIZE);
  }
 
+/*
+ * The functions below are Linux-isms that will likely never be implemented
+ * on FreeBSD unless FreeBSD also implements something akin to Linux dmabuf.
+ */
+int osdep_gnttab_dmabuf_exp_from_refs(xengnttab_handle *xgt, uint32_t domid,
+                                      uint32_t flags, uint32_t count,
+                                      const uint32_t *refs,
+                                      uint32_t *dmabuf_fd)
+{
+    abort();
+}
+
+int osdep_gnttab_dmabuf_exp_wait_released(xengnttab_handle *xgt,
+                                          uint32_t fd, uint32_t wait_to_ms)
+{
+    abort();
+}
+
+int osdep_gnttab_dmabuf_imp_to_refs(xengnttab_handle *xgt, uint32_t domid,
+                                    uint32_t fd, uint32_t count, uint32_t *refs)
+{
+    abort();

tools/libs/gnttab/freebsd.c int osdep_gntshr_unshare(xengntshr_handle *xgs, · line 341

Quoted 10 lines
tools/libs/gnttab/freebsd.c +7 -0
+}
+
+int osdep_gnttab_dmabuf_imp_release(xengnttab_handle *xgt, uint32_t fd)
+{
+    abort();
+}
+
  /*
   * Local variables:
   * mode: C

_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xenproject.org/mailman/listinfo/xen-devel