[PATCH v3 00/23] xl / libxl: named PCI pass-through devices

Paul Durrant posted 23 patches 3 years, 5 months ago
Patches applied successfully (tree, apply log)
git fetch https://gitlab.com/xen-project/patchew/xen tags/patchew/20201123174503.6800-1-paul@xen.org
There is a newer version of this series
docs/man/xl-pci-configuration.5.pod  |  218 +++++++
docs/man/xl.1.pod.in                 |   39 +-
docs/man/xl.cfg.5.pod.in             |   68 +--
tools/golang/xenlight/helpers.gen.go |   77 ++-
tools/golang/xenlight/types.gen.go   |    8 +-
tools/include/libxl.h                |   67 ++-
tools/include/libxlutil.h            |    8 +-
tools/libs/light/libxl_create.c      |    6 +-
tools/libs/light/libxl_device.c      |   66 ++-
tools/libs/light/libxl_dm.c          |   18 +-
tools/libs/light/libxl_internal.h    |   55 +-
tools/libs/light/libxl_pci.c         | 1048 ++++++++++++++++++----------------
tools/libs/light/libxl_types.idl     |   19 +-
tools/libs/util/libxlu_pci.c         |  359 ++++++------
tools/ocaml/libs/xl/xenlight_stubs.c |   19 +-
tools/xl/xl_cmdtable.c               |   16 +-
tools/xl/xl_parse.c                  |   30 +-
tools/xl/xl_pci.c                    |  163 +++---
tools/xl/xl_sxp.c                    |   12 +-
19 files changed, 1367 insertions(+), 929 deletions(-)
create mode 100644 docs/man/xl-pci-configuration.5.pod
[PATCH v3 00/23] xl / libxl: named PCI pass-through devices
Posted by Paul Durrant 3 years, 5 months ago
From: Paul Durrant <pdurrant@amazon.com>

Paul Durrant (23):
  xl / libxl: s/pcidev/pci and remove DEFINE_DEVICE_TYPE_STRUCT_X
  libxl: make libxl__device_list() work correctly for
    LIBXL__DEVICE_KIND_PCI...
  libxl: Make sure devices added by pci-attach are reflected in the
    config
  libxl: add/recover 'rdm_policy' to/from PCI backend in xenstore
  libxl: s/detatched/detached in libxl_pci.c
  libxl: remove extraneous arguments to do_pci_remove() in libxl_pci.c
  libxl: stop using aodev->device_config in libxl__device_pci_add()...
  libxl: generalise 'driver_path' xenstore access functions in
    libxl_pci.c
  libxl: remove unnecessary check from libxl__device_pci_add()
  libxl: remove get_all_assigned_devices() from libxl_pci.c
  libxl: make sure callers of libxl_device_pci_list() free the list
    after use
  libxl: add libxl_device_pci_assignable_list_free()...
  libxl: use COMPARE_PCI() macro is_pci_in_array()...
  docs/man: extract documentation of PCI_SPEC_STRING from the xl.cfg
    manpage...
  docs/man: improve documentation of PCI_SPEC_STRING...
  docs/man: fix xl(1) documentation for 'pci' operations
  libxl: introduce 'libxl_pci_bdf' in the idl...
  libxlu: introduce xlu_pci_parse_spec_string()
  libxl: modify
    libxl_device_pci_assignable_add/remove/list/list_free()...
  docs/man: modify xl(1) in preparation for naming of assignable devices
  xl / libxl: support naming of assignable devices
  docs/man: modify xl-pci-configuration(5) to add 'name' field to
    PCI_SPEC_STRING
  xl / libxl: support 'xl pci-attach/detach' by name

 docs/man/xl-pci-configuration.5.pod  |  218 +++++++
 docs/man/xl.1.pod.in                 |   39 +-
 docs/man/xl.cfg.5.pod.in             |   68 +--
 tools/golang/xenlight/helpers.gen.go |   77 ++-
 tools/golang/xenlight/types.gen.go   |    8 +-
 tools/include/libxl.h                |   67 ++-
 tools/include/libxlutil.h            |    8 +-
 tools/libs/light/libxl_create.c      |    6 +-
 tools/libs/light/libxl_device.c      |   66 ++-
 tools/libs/light/libxl_dm.c          |   18 +-
 tools/libs/light/libxl_internal.h    |   55 +-
 tools/libs/light/libxl_pci.c         | 1048 ++++++++++++++++++----------------
 tools/libs/light/libxl_types.idl     |   19 +-
 tools/libs/util/libxlu_pci.c         |  359 ++++++------
 tools/ocaml/libs/xl/xenlight_stubs.c |   19 +-
 tools/xl/xl_cmdtable.c               |   16 +-
 tools/xl/xl_parse.c                  |   30 +-
 tools/xl/xl_pci.c                    |  163 +++---
 tools/xl/xl_sxp.c                    |   12 +-
 19 files changed, 1367 insertions(+), 929 deletions(-)
 create mode 100644 docs/man/xl-pci-configuration.5.pod
---
Cc: Anthony PERARD <anthony.perard@citrix.com>
Cc: Christian Lindig <christian.lindig@citrix.com>
Cc: David Scott <dave@recoil.org>
Cc: George Dunlap <george.dunlap@citrix.com>
Cc: Ian Jackson <iwj@xenproject.org>
Cc: Nick Rosbrook <rosbrookn@ainfosec.com>
Cc: Wei Liu <wl@xen.org>
-- 
2.11.0


Re: [PATCH v3 00/23] xl / libxl: named PCI pass-through devices
Posted by Andrew Cooper 3 years, 5 months ago
On 23/11/2020 17:44, Paul Durrant wrote:
> From: Paul Durrant <pdurrant@amazon.com>
>
> Paul Durrant (23):
>   xl / libxl: s/pcidev/pci and remove DEFINE_DEVICE_TYPE_STRUCT_X
>   libxl: make libxl__device_list() work correctly for
>     LIBXL__DEVICE_KIND_PCI...
>   libxl: Make sure devices added by pci-attach are reflected in the
>     config
>   libxl: add/recover 'rdm_policy' to/from PCI backend in xenstore
>   libxl: s/detatched/detached in libxl_pci.c
>   libxl: remove extraneous arguments to do_pci_remove() in libxl_pci.c
>   libxl: stop using aodev->device_config in libxl__device_pci_add()...
>   libxl: generalise 'driver_path' xenstore access functions in
>     libxl_pci.c
>   libxl: remove unnecessary check from libxl__device_pci_add()
>   libxl: remove get_all_assigned_devices() from libxl_pci.c
>   libxl: make sure callers of libxl_device_pci_list() free the list
>     after use
>   libxl: add libxl_device_pci_assignable_list_free()...
>   libxl: use COMPARE_PCI() macro is_pci_in_array()...
>   docs/man: extract documentation of PCI_SPEC_STRING from the xl.cfg
>     manpage...
>   docs/man: improve documentation of PCI_SPEC_STRING...
>   docs/man: fix xl(1) documentation for 'pci' operations
>   libxl: introduce 'libxl_pci_bdf' in the idl...
>   libxlu: introduce xlu_pci_parse_spec_string()
>   libxl: modify
>     libxl_device_pci_assignable_add/remove/list/list_free()...
>   docs/man: modify xl(1) in preparation for naming of assignable devices
>   xl / libxl: support naming of assignable devices
>   docs/man: modify xl-pci-configuration(5) to add 'name' field to
>     PCI_SPEC_STRING
>   xl / libxl: support 'xl pci-attach/detach' by name

We're trying to get the CI loop up and running.  Its not emailing
xen-devel yet, but has found a real error somewhere in this series.

https://gitlab.com/xen-project/patchew/xen/-/pipelines/220153571

~Andrew

RE: [PATCH v3 00/23] xl / libxl: named PCI pass-through devices
Posted by Paul Durrant 3 years, 5 months ago
> -----Original Message-----
> From: Andrew Cooper <andrew.cooper3@citrix.com>
> Sent: 23 November 2020 22:18
> To: Paul Durrant <paul@xen.org>; xen-devel@lists.xenproject.org
> Cc: Paul Durrant <pdurrant@amazon.com>; Anthony PERARD <anthony.perard@citrix.com>; Christian Lindig
> <christian.lindig@citrix.com>; David Scott <dave@recoil.org>; George Dunlap
> <george.dunlap@citrix.com>; Ian Jackson <iwj@xenproject.org>; Nick Rosbrook <rosbrookn@ainfosec.com>;
> Wei Liu <wl@xen.org>
> Subject: Re: [PATCH v3 00/23] xl / libxl: named PCI pass-through devices
> 
> On 23/11/2020 17:44, Paul Durrant wrote:
> > From: Paul Durrant <pdurrant@amazon.com>
> >
> > Paul Durrant (23):
> >   xl / libxl: s/pcidev/pci and remove DEFINE_DEVICE_TYPE_STRUCT_X
> >   libxl: make libxl__device_list() work correctly for
> >     LIBXL__DEVICE_KIND_PCI...
> >   libxl: Make sure devices added by pci-attach are reflected in the
> >     config
> >   libxl: add/recover 'rdm_policy' to/from PCI backend in xenstore
> >   libxl: s/detatched/detached in libxl_pci.c
> >   libxl: remove extraneous arguments to do_pci_remove() in libxl_pci.c
> >   libxl: stop using aodev->device_config in libxl__device_pci_add()...
> >   libxl: generalise 'driver_path' xenstore access functions in
> >     libxl_pci.c
> >   libxl: remove unnecessary check from libxl__device_pci_add()
> >   libxl: remove get_all_assigned_devices() from libxl_pci.c
> >   libxl: make sure callers of libxl_device_pci_list() free the list
> >     after use
> >   libxl: add libxl_device_pci_assignable_list_free()...
> >   libxl: use COMPARE_PCI() macro is_pci_in_array()...
> >   docs/man: extract documentation of PCI_SPEC_STRING from the xl.cfg
> >     manpage...
> >   docs/man: improve documentation of PCI_SPEC_STRING...
> >   docs/man: fix xl(1) documentation for 'pci' operations
> >   libxl: introduce 'libxl_pci_bdf' in the idl...
> >   libxlu: introduce xlu_pci_parse_spec_string()
> >   libxl: modify
> >     libxl_device_pci_assignable_add/remove/list/list_free()...
> >   docs/man: modify xl(1) in preparation for naming of assignable devices
> >   xl / libxl: support naming of assignable devices
> >   docs/man: modify xl-pci-configuration(5) to add 'name' field to
> >     PCI_SPEC_STRING
> >   xl / libxl: support 'xl pci-attach/detach' by name
> 
> We're trying to get the CI loop up and running.  Its not emailing
> xen-devel yet, but has found a real error somewhere in this series.
> 
> https://gitlab.com/xen-project/patchew/xen/-/pipelines/220153571
> 

Found it, thanks...

libxl_pci.c: In function 'libxl_device_pci_assignable_name2bdf':
libxl_pci.c:970:5: error: 'pcibdf' may be used uninitialized in this function [-Werror=maybe-uninitialized]
     return pcibdf;
     ^

Odd that my local build (debian 9.13) didn't pick it up. Will send a v4 shortly.

  Paul

> ~Andrew