[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [Xen-changelog] [xen-unstable] tools/ocaml: libxc bindings: Fix SBDF encoding
# HG changeset patch # User Andrew Cooper <andrew.cooper3@xxxxxxxxxx> # Date 1357906949 0 # Node ID 56daf05bcf69db56476bb7b97600292e791253c3 # Parent 9a1610c1e564cdc49b8bf628694632a63c6f6b63 tools/ocaml: libxc bindings: Fix SBDF encoding Changeset 23861:ec7c81fbe0de alters the SBDF encoding expected by the DOMCTL_{de,}assign_device hypercalls. While it updates libxl, libxc and the python bindings, the ocaml bindings got missed. As a result, any attempt to use PCI Passthrough with Xen-4.2 and later will fail. Signed-off-by: Andrew Cooper <andrew.cooper3@xxxxxxxxxx> Acked-by: Ian Campbell <ian.campbell@xxxxxxxxxx> Committed-by: Ian Campbell <ian.campbell@xxxxxxxxxx> --- diff -r 9a1610c1e564 -r 56daf05bcf69 tools/ocaml/libs/xc/xenctrl_stubs.c --- a/tools/ocaml/libs/xc/xenctrl_stubs.c Fri Jan 11 12:22:28 2013 +0000 +++ b/tools/ocaml/libs/xc/xenctrl_stubs.c Fri Jan 11 12:22:29 2013 +0000 @@ -1085,11 +1085,10 @@ CAMLprim value stub_xc_domain_irq_permis static uint32_t pci_dev_to_bdf(int domain, int bus, int slot, int func) { - uint32_t bdf = 0; - bdf |= (bus & 0xff) << 16; - bdf |= (slot & 0x1f) << 11; - bdf |= (func & 0x7) << 8; - return bdf; + return ((uint32_t)domain & 0xffff) << 16 | + ((uint32_t)bus & 0xff) << 8 | + ((uint32_t)slot & 0x1f) << 3 | + ((uint32_t)func & 0x7); } CAMLprim value stub_xc_domain_test_assign_device(value xch, value domid, value desc) _______________________________________________ Xen-changelog mailing list Xen-changelog@xxxxxxxxxxxxx http://lists.xensource.com/xen-changelog
|
Lists.xenproject.org is hosted with RackSpace, monitoring our |