[libvirt] [PATCH v2 RESEND 00/12] PCI passthrough support on s390

Yi Min Zhao posted 12 patches 1 week ago
Patches applied successfully (tree, apply log)
git fetch https://github.com/patchew-project/libvirt tags/patchew/20180710080226.24107-1-zyimin@linux.ibm.com
Test syntax-check passed
docs/formatdomain.html.in                          |   9 +-
docs/news.xml                                      |  11 +
docs/schemas/basictypes.rng                        |  31 ++
docs/schemas/domaincommon.rng                      |   1 +
src/conf/device_conf.c                             |  73 +++++
src/conf/device_conf.h                             |   1 +
src/conf/domain_addr.c                             | 346 +++++++++++++++++++++
src/conf/domain_addr.h                             |  29 ++
src/conf/domain_conf.c                             |   6 +
src/libvirt_private.syms                           |   4 +
src/qemu/qemu_capabilities.c                       |   6 +
src/qemu/qemu_capabilities.h                       |   1 +
src/qemu/qemu_command.c                            | 115 +++++++
src/qemu/qemu_command.h                            |   4 +
src/qemu/qemu_domain.c                             |   1 +
src/qemu/qemu_domain_address.c                     | 181 ++++++++++-
src/qemu/qemu_hotplug.c                            | 182 ++++++++++-
src/util/virpci.h                                  |  13 +
tests/qemucapabilitiesdata/caps_2.10.0.s390x.xml   |   1 +
tests/qemucapabilitiesdata/caps_2.11.0.s390x.xml   |   1 +
tests/qemucapabilitiesdata/caps_2.12.0.s390x.xml   |   1 +
tests/qemucapabilitiesdata/caps_2.7.0.s390x.xml    |   1 +
tests/qemucapabilitiesdata/caps_2.8.0.s390x.xml    |   1 +
tests/qemucapabilitiesdata/caps_2.9.0.s390x.xml    |   1 +
tests/qemuxml2argvdata/disk-virtio-s390-zpci.args  |  27 ++
tests/qemuxml2argvdata/disk-virtio-s390-zpci.xml   |  17 +
.../hostdev-vfio-zpci-autogenerate.args            |  26 ++
.../hostdev-vfio-zpci-autogenerate.xml             |  18 ++
.../hostdev-vfio-zpci-boundaries.args              |  30 ++
.../hostdev-vfio-zpci-boundaries.xml               |  26 ++
.../hostdev-vfio-zpci-multidomain-many.args        |  40 +++
.../hostdev-vfio-zpci-multidomain-many.xml         |  67 ++++
tests/qemuxml2argvdata/hostdev-vfio-zpci.args      |  26 ++
tests/qemuxml2argvdata/hostdev-vfio-zpci.xml       |  19 ++
tests/qemuxml2argvtest.c                           |  14 +
tests/qemuxml2xmloutdata/disk-virtio-s390-zpci.xml |  29 ++
tests/qemuxml2xmloutdata/hostdev-vfio-zpci.xml     |  30 ++
tests/qemuxml2xmltest.c                            |   3 +
38 files changed, 1377 insertions(+), 15 deletions(-)
create mode 100644 tests/qemuxml2argvdata/disk-virtio-s390-zpci.args
create mode 100644 tests/qemuxml2argvdata/disk-virtio-s390-zpci.xml
create mode 100644 tests/qemuxml2argvdata/hostdev-vfio-zpci-autogenerate.args
create mode 100644 tests/qemuxml2argvdata/hostdev-vfio-zpci-autogenerate.xml
create mode 100644 tests/qemuxml2argvdata/hostdev-vfio-zpci-boundaries.args
create mode 100644 tests/qemuxml2argvdata/hostdev-vfio-zpci-boundaries.xml
create mode 100644 tests/qemuxml2argvdata/hostdev-vfio-zpci-multidomain-many.args
create mode 100644 tests/qemuxml2argvdata/hostdev-vfio-zpci-multidomain-many.xml
create mode 100644 tests/qemuxml2argvdata/hostdev-vfio-zpci.args
create mode 100644 tests/qemuxml2argvdata/hostdev-vfio-zpci.xml
create mode 100644 tests/qemuxml2xmloutdata/disk-virtio-s390-zpci.xml
create mode 100644 tests/qemuxml2xmloutdata/hostdev-vfio-zpci.xml

[libvirt] [PATCH v2 RESEND 00/12] PCI passthrough support on s390

Posted by Yi Min Zhao 1 week ago
Abstract
========
The PCI representation in QEMU has recently been extended for S390
allowing configuration of zPCI attributes like uid (user-defined
identifier) and fid (PCI function identifier).
The details can be found here:
https://lists.gnu.org/archive/html/qemu-devel/2016-06/msg07262.html

To support the new zPCI feature of the S390 platform, two new XML
attributes, @uid and @fid, are introduced for device addresses of type
'pci', i.e.:
  <hostdev mode='subsystem' type='pci'>
    <driver name='vfio'/>
    <source>
      <address domain='0x0001' bus='0x00' slot='0x00' function='0x0'/>
    </source>
    <address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x0'
      uid='0x0003' fid='0x00000027'/>
  </hostdev>

uid and fid are optional attributes. If they are defined by the user,
unique values within the guest domain must be used. If they are not
specified and the architecture requires them, they are automatically
generated with non-conflicting values.

Current implementation is the most seamless one for the user as it
unites the address specific data of a PCI device on one XML element.
It could accommodate both specifying our special parameters (uid and fid)
and re-using standard statements (domain, bus, slot and function) for
PCI devices. User can still specify bus/slot/function for the virtualized
PCI devices in the XML.

Thus uid/fid act as an extension to the PCI address and are stored in
a new structure 'virZPCIDeviceAddress' which is a member of common PCI
Address structure. Additionally, two hashtables are used for assignment
and reservation of uid/fid.

In support of extending the PCI address, a new PCI address extension flag is
introduced. This extension flag allows is not only dedicated for the S390
platform but also other architectures needing certain extensions to PCI
address space.

Code Base
=========
commit in master:
767f9e1449b1a36111532847f0c62dc758263c42
qemu: validate: Enforce compile time switch type checking for videos

Change Log
==========
v1->v2:
1. Separate test commit and merge testcases into corresponding commits that
   introduce the functionalities firstly.
2. Spare some checks for zpci device.
3. Add vsock and controller support.
4. Add uin32 type schema.
5. Rename zpciuid and zpcifid to zpci_uid and zpci_fid.
6. Always return multibus support on S390.

Yi Min Zhao (12):
  conf: Add definitions for 'uid' and 'fid' PCI address attributes
  qemu: Introduce zPCI capability
  conf: Introduce a new PCI address extension flag
  qemu: Enable PCI multi bus for S390 guests
  qemu: Auto add pci-root for s390/s390x guests
  conf: Introduce address caching for PCI extensions
  conf: Introduce parser, formatter for uid and fid
  conf: Allocate/release 'uid' and 'fid' in PCI address
  qemu: Generate and use zPCI device in QEMU command line
  qemu: Add hotpluging support for PCI devices on S390 guests
  docs: Add 'uid' and 'fid' information
  news: Update news for PCI address extension attributes

 docs/formatdomain.html.in                          |   9 +-
 docs/news.xml                                      |  11 +
 docs/schemas/basictypes.rng                        |  31 ++
 docs/schemas/domaincommon.rng                      |   1 +
 src/conf/device_conf.c                             |  73 +++++
 src/conf/device_conf.h                             |   1 +
 src/conf/domain_addr.c                             | 346 +++++++++++++++++++++
 src/conf/domain_addr.h                             |  29 ++
 src/conf/domain_conf.c                             |   6 +
 src/libvirt_private.syms                           |   4 +
 src/qemu/qemu_capabilities.c                       |   6 +
 src/qemu/qemu_capabilities.h                       |   1 +
 src/qemu/qemu_command.c                            | 115 +++++++
 src/qemu/qemu_command.h                            |   4 +
 src/qemu/qemu_domain.c                             |   1 +
 src/qemu/qemu_domain_address.c                     | 181 ++++++++++-
 src/qemu/qemu_hotplug.c                            | 182 ++++++++++-
 src/util/virpci.h                                  |  13 +
 tests/qemucapabilitiesdata/caps_2.10.0.s390x.xml   |   1 +
 tests/qemucapabilitiesdata/caps_2.11.0.s390x.xml   |   1 +
 tests/qemucapabilitiesdata/caps_2.12.0.s390x.xml   |   1 +
 tests/qemucapabilitiesdata/caps_2.7.0.s390x.xml    |   1 +
 tests/qemucapabilitiesdata/caps_2.8.0.s390x.xml    |   1 +
 tests/qemucapabilitiesdata/caps_2.9.0.s390x.xml    |   1 +
 tests/qemuxml2argvdata/disk-virtio-s390-zpci.args  |  27 ++
 tests/qemuxml2argvdata/disk-virtio-s390-zpci.xml   |  17 +
 .../hostdev-vfio-zpci-autogenerate.args            |  26 ++
 .../hostdev-vfio-zpci-autogenerate.xml             |  18 ++
 .../hostdev-vfio-zpci-boundaries.args              |  30 ++
 .../hostdev-vfio-zpci-boundaries.xml               |  26 ++
 .../hostdev-vfio-zpci-multidomain-many.args        |  40 +++
 .../hostdev-vfio-zpci-multidomain-many.xml         |  67 ++++
 tests/qemuxml2argvdata/hostdev-vfio-zpci.args      |  26 ++
 tests/qemuxml2argvdata/hostdev-vfio-zpci.xml       |  19 ++
 tests/qemuxml2argvtest.c                           |  14 +
 tests/qemuxml2xmloutdata/disk-virtio-s390-zpci.xml |  29 ++
 tests/qemuxml2xmloutdata/hostdev-vfio-zpci.xml     |  30 ++
 tests/qemuxml2xmltest.c                            |   3 +
 38 files changed, 1377 insertions(+), 15 deletions(-)
 create mode 100644 tests/qemuxml2argvdata/disk-virtio-s390-zpci.args
 create mode 100644 tests/qemuxml2argvdata/disk-virtio-s390-zpci.xml
 create mode 100644 tests/qemuxml2argvdata/hostdev-vfio-zpci-autogenerate.args
 create mode 100644 tests/qemuxml2argvdata/hostdev-vfio-zpci-autogenerate.xml
 create mode 100644 tests/qemuxml2argvdata/hostdev-vfio-zpci-boundaries.args
 create mode 100644 tests/qemuxml2argvdata/hostdev-vfio-zpci-boundaries.xml
 create mode 100644 tests/qemuxml2argvdata/hostdev-vfio-zpci-multidomain-many.args
 create mode 100644 tests/qemuxml2argvdata/hostdev-vfio-zpci-multidomain-many.xml
 create mode 100644 tests/qemuxml2argvdata/hostdev-vfio-zpci.args
 create mode 100644 tests/qemuxml2argvdata/hostdev-vfio-zpci.xml
 create mode 100644 tests/qemuxml2xmloutdata/disk-virtio-s390-zpci.xml
 create mode 100644 tests/qemuxml2xmloutdata/hostdev-vfio-zpci.xml

-- 
Yi Min

--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list

Re: [libvirt] [PATCH v2 RESEND 00/12] PCI passthrough support on s390

Posted by Cornelia Huck 5 days ago
On Tue, 10 Jul 2018 16:02:14 +0800
Yi Min Zhao <zyimin@linux.ibm.com> wrote:

> Abstract
> ========
> The PCI representation in QEMU has recently been extended for S390
> allowing configuration of zPCI attributes like uid (user-defined
> identifier) and fid (PCI function identifier).
> The details can be found here:
> https://lists.gnu.org/archive/html/qemu-devel/2016-06/msg07262.html
> 
> To support the new zPCI feature of the S390 platform, two new XML
> attributes, @uid and @fid, are introduced for device addresses of type
> 'pci', i.e.:
>   <hostdev mode='subsystem' type='pci'>
>     <driver name='vfio'/>
>     <source>
>       <address domain='0x0001' bus='0x00' slot='0x00' function='0x0'/>
>     </source>
>     <address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x0'
>       uid='0x0003' fid='0x00000027'/>
>   </hostdev>
> 
> uid and fid are optional attributes. If they are defined by the user,
> unique values within the guest domain must be used. If they are not
> specified and the architecture requires them, they are automatically
> generated with non-conflicting values.
> 
> Current implementation is the most seamless one for the user as it
> unites the address specific data of a PCI device on one XML element.
> It could accommodate both specifying our special parameters (uid and fid)
> and re-using standard statements (domain, bus, slot and function) for
> PCI devices. User can still specify bus/slot/function for the virtualized
> PCI devices in the XML.
> 
> Thus uid/fid act as an extension to the PCI address and are stored in
> a new structure 'virZPCIDeviceAddress' which is a member of common PCI
> Address structure. Additionally, two hashtables are used for assignment
> and reservation of uid/fid.
> 
> In support of extending the PCI address, a new PCI address extension flag is
> introduced. This extension flag allows is not only dedicated for the S390
> platform but also other architectures needing certain extensions to PCI
> address space.

FWIW, from my QEMU POV there's nothing obviously wrong in here, but I'm
not familiar with the libvirt code base. So I'll leave this to the
libvirt developers.

--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list

Re: [libvirt] [PATCH v2 RESEND 00/12] PCI passthrough support on s390

Posted by Yi Min Zhao 4 days ago

在 2018/7/17 下午8:35, Cornelia Huck 写道:
> On Tue, 10 Jul 2018 16:02:14 +0800
> Yi Min Zhao <zyimin@linux.ibm.com> wrote:
>
>> Abstract
>> ========
>> The PCI representation in QEMU has recently been extended for S390
>> allowing configuration of zPCI attributes like uid (user-defined
>> identifier) and fid (PCI function identifier).
>> The details can be found here:
>> https://lists.gnu.org/archive/html/qemu-devel/2016-06/msg07262.html
>>
>> To support the new zPCI feature of the S390 platform, two new XML
>> attributes, @uid and @fid, are introduced for device addresses of type
>> 'pci', i.e.:
>>    <hostdev mode='subsystem' type='pci'>
>>      <driver name='vfio'/>
>>      <source>
>>        <address domain='0x0001' bus='0x00' slot='0x00' function='0x0'/>
>>      </source>
>>      <address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x0'
>>        uid='0x0003' fid='0x00000027'/>
>>    </hostdev>
>>
>> uid and fid are optional attributes. If they are defined by the user,
>> unique values within the guest domain must be used. If they are not
>> specified and the architecture requires them, they are automatically
>> generated with non-conflicting values.
>>
>> Current implementation is the most seamless one for the user as it
>> unites the address specific data of a PCI device on one XML element.
>> It could accommodate both specifying our special parameters (uid and fid)
>> and re-using standard statements (domain, bus, slot and function) for
>> PCI devices. User can still specify bus/slot/function for the virtualized
>> PCI devices in the XML.
>>
>> Thus uid/fid act as an extension to the PCI address and are stored in
>> a new structure 'virZPCIDeviceAddress' which is a member of common PCI
>> Address structure. Additionally, two hashtables are used for assignment
>> and reservation of uid/fid.
>>
>> In support of extending the PCI address, a new PCI address extension flag is
>> introduced. This extension flag allows is not only dedicated for the S390
>> platform but also other architectures needing certain extensions to PCI
>> address space.
> FWIW, from my QEMU POV there's nothing obviously wrong in here, but I'm
> not familiar with the libvirt code base. So I'll leave this to the
> libvirt developers.
>
>
Thanks! Libvirt developers have not given any comment on v2 until now.
I'm afraid the end of this month is coming soon.

--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list

Re: [libvirt] [PATCH v2 RESEND 00/12] PCI passthrough support on s390

Posted by Yi Min Zhao 4 hours ago
Hi all,

The next release is coming soon. I'm really expecting the comments from 
all of you.

Hope you could consider a review before the next review.

Thank you very much!

Yi Min

在 2018/7/10 下午4:02, Yi Min Zhao 写道:
> Abstract
> ========
> The PCI representation in QEMU has recently been extended for S390
> allowing configuration of zPCI attributes like uid (user-defined
> identifier) and fid (PCI function identifier).
> The details can be found here:
> https://lists.gnu.org/archive/html/qemu-devel/2016-06/msg07262.html
>
> To support the new zPCI feature of the S390 platform, two new XML
> attributes, @uid and @fid, are introduced for device addresses of type
> 'pci', i.e.:
>    <hostdev mode='subsystem' type='pci'>
>      <driver name='vfio'/>
>      <source>
>        <address domain='0x0001' bus='0x00' slot='0x00' function='0x0'/>
>      </source>
>      <address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x0'
>        uid='0x0003' fid='0x00000027'/>
>    </hostdev>
>
> uid and fid are optional attributes. If they are defined by the user,
> unique values within the guest domain must be used. If they are not
> specified and the architecture requires them, they are automatically
> generated with non-conflicting values.
>
> Current implementation is the most seamless one for the user as it
> unites the address specific data of a PCI device on one XML element.
> It could accommodate both specifying our special parameters (uid and fid)
> and re-using standard statements (domain, bus, slot and function) for
> PCI devices. User can still specify bus/slot/function for the virtualized
> PCI devices in the XML.
>
> Thus uid/fid act as an extension to the PCI address and are stored in
> a new structure 'virZPCIDeviceAddress' which is a member of common PCI
> Address structure. Additionally, two hashtables are used for assignment
> and reservation of uid/fid.
>
> In support of extending the PCI address, a new PCI address extension flag is
> introduced. This extension flag allows is not only dedicated for the S390
> platform but also other architectures needing certain extensions to PCI
> address space.
>
> Code Base
> =========
> commit in master:
> 767f9e1449b1a36111532847f0c62dc758263c42
> qemu: validate: Enforce compile time switch type checking for videos
>
> Change Log
> ==========
> v1->v2:
> 1. Separate test commit and merge testcases into corresponding commits that
>     introduce the functionalities firstly.
> 2. Spare some checks for zpci device.
> 3. Add vsock and controller support.
> 4. Add uin32 type schema.
> 5. Rename zpciuid and zpcifid to zpci_uid and zpci_fid.
> 6. Always return multibus support on S390.
>
> Yi Min Zhao (12):
>    conf: Add definitions for 'uid' and 'fid' PCI address attributes
>    qemu: Introduce zPCI capability
>    conf: Introduce a new PCI address extension flag
>    qemu: Enable PCI multi bus for S390 guests
>    qemu: Auto add pci-root for s390/s390x guests
>    conf: Introduce address caching for PCI extensions
>    conf: Introduce parser, formatter for uid and fid
>    conf: Allocate/release 'uid' and 'fid' in PCI address
>    qemu: Generate and use zPCI device in QEMU command line
>    qemu: Add hotpluging support for PCI devices on S390 guests
>    docs: Add 'uid' and 'fid' information
>    news: Update news for PCI address extension attributes
>
>   docs/formatdomain.html.in                          |   9 +-
>   docs/news.xml                                      |  11 +
>   docs/schemas/basictypes.rng                        |  31 ++
>   docs/schemas/domaincommon.rng                      |   1 +
>   src/conf/device_conf.c                             |  73 +++++
>   src/conf/device_conf.h                             |   1 +
>   src/conf/domain_addr.c                             | 346 +++++++++++++++++++++
>   src/conf/domain_addr.h                             |  29 ++
>   src/conf/domain_conf.c                             |   6 +
>   src/libvirt_private.syms                           |   4 +
>   src/qemu/qemu_capabilities.c                       |   6 +
>   src/qemu/qemu_capabilities.h                       |   1 +
>   src/qemu/qemu_command.c                            | 115 +++++++
>   src/qemu/qemu_command.h                            |   4 +
>   src/qemu/qemu_domain.c                             |   1 +
>   src/qemu/qemu_domain_address.c                     | 181 ++++++++++-
>   src/qemu/qemu_hotplug.c                            | 182 ++++++++++-
>   src/util/virpci.h                                  |  13 +
>   tests/qemucapabilitiesdata/caps_2.10.0.s390x.xml   |   1 +
>   tests/qemucapabilitiesdata/caps_2.11.0.s390x.xml   |   1 +
>   tests/qemucapabilitiesdata/caps_2.12.0.s390x.xml   |   1 +
>   tests/qemucapabilitiesdata/caps_2.7.0.s390x.xml    |   1 +
>   tests/qemucapabilitiesdata/caps_2.8.0.s390x.xml    |   1 +
>   tests/qemucapabilitiesdata/caps_2.9.0.s390x.xml    |   1 +
>   tests/qemuxml2argvdata/disk-virtio-s390-zpci.args  |  27 ++
>   tests/qemuxml2argvdata/disk-virtio-s390-zpci.xml   |  17 +
>   .../hostdev-vfio-zpci-autogenerate.args            |  26 ++
>   .../hostdev-vfio-zpci-autogenerate.xml             |  18 ++
>   .../hostdev-vfio-zpci-boundaries.args              |  30 ++
>   .../hostdev-vfio-zpci-boundaries.xml               |  26 ++
>   .../hostdev-vfio-zpci-multidomain-many.args        |  40 +++
>   .../hostdev-vfio-zpci-multidomain-many.xml         |  67 ++++
>   tests/qemuxml2argvdata/hostdev-vfio-zpci.args      |  26 ++
>   tests/qemuxml2argvdata/hostdev-vfio-zpci.xml       |  19 ++
>   tests/qemuxml2argvtest.c                           |  14 +
>   tests/qemuxml2xmloutdata/disk-virtio-s390-zpci.xml |  29 ++
>   tests/qemuxml2xmloutdata/hostdev-vfio-zpci.xml     |  30 ++
>   tests/qemuxml2xmltest.c                            |   3 +
>   38 files changed, 1377 insertions(+), 15 deletions(-)
>   create mode 100644 tests/qemuxml2argvdata/disk-virtio-s390-zpci.args
>   create mode 100644 tests/qemuxml2argvdata/disk-virtio-s390-zpci.xml
>   create mode 100644 tests/qemuxml2argvdata/hostdev-vfio-zpci-autogenerate.args
>   create mode 100644 tests/qemuxml2argvdata/hostdev-vfio-zpci-autogenerate.xml
>   create mode 100644 tests/qemuxml2argvdata/hostdev-vfio-zpci-boundaries.args
>   create mode 100644 tests/qemuxml2argvdata/hostdev-vfio-zpci-boundaries.xml
>   create mode 100644 tests/qemuxml2argvdata/hostdev-vfio-zpci-multidomain-many.args
>   create mode 100644 tests/qemuxml2argvdata/hostdev-vfio-zpci-multidomain-many.xml
>   create mode 100644 tests/qemuxml2argvdata/hostdev-vfio-zpci.args
>   create mode 100644 tests/qemuxml2argvdata/hostdev-vfio-zpci.xml
>   create mode 100644 tests/qemuxml2xmloutdata/disk-virtio-s390-zpci.xml
>   create mode 100644 tests/qemuxml2xmloutdata/hostdev-vfio-zpci.xml
>

--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list