[libvirt] [PATCH v2 0/3] qemu: guest dedicated crypto adapters

v2: + added singleton check for vfio-ap mediated device This patch series introduces initial libvirt support for guest dedicated crypto adapters on S390. It allows to specify a vfio-ap mediated device in a domain. Extensive documentation about AP is available in patch 6 of the QEMU patch series. KVM/kernel: guest dedicated crypto adapters https://lkml.org/lkml/2018/9/26/25 QEMU: s390x: vfio-ap: guest dedicated crypto adapters https://lists.gnu.org/archive/html/qemu-devel/2018-10/msg01993.html The qemu patch series has been included into master. https://git.qemu.org/?p=qemu.git;a=commit;h=69ac8c4cb93f2685839ff7b857cef306... Boris Fiuczynski (3): qemu: add vfio-ap capability qemu: vfio-ap device support news: Update news for vfio-ap support docs/formatdomain.html.in | 3 ++- docs/news.xml | 9 +++++++++ docs/schemas/domaincommon.rng | 1 + src/conf/domain_conf.c | 28 ++++++++++++++++++++++++++++ src/qemu/qemu_capabilities.c | 2 ++ src/qemu/qemu_capabilities.h | 1 + src/qemu/qemu_command.c | 8 ++++++++ src/qemu/qemu_domain_address.c | 4 ++++ src/util/virmdev.c | 3 ++- src/util/virmdev.h | 1 + 10 files changed, 58 insertions(+), 2 deletions(-) -- 2.17.0

Introduce vfio-ap capability. Signed-off-by: Boris Fiuczynski <fiuczy@linux.ibm.com> Reviewed-by: Bjoern Walk <bwalk@linux.ibm.com> --- src/qemu/qemu_capabilities.c | 2 ++ src/qemu/qemu_capabilities.h | 1 + 2 files changed, 3 insertions(+) diff --git a/src/qemu/qemu_capabilities.c b/src/qemu/qemu_capabilities.c index e228f52ec0..2ca5af3297 100644 --- a/src/qemu/qemu_capabilities.c +++ b/src/qemu/qemu_capabilities.c @@ -508,6 +508,7 @@ VIR_ENUM_IMPL(virQEMUCaps, QEMU_CAPS_LAST, /* 315 */ "vfio-pci.display", "blockdev", + "vfio-ap", ); @@ -1092,6 +1093,7 @@ struct virQEMUCapsStringFlags virQEMUCapsObjectTypes[] = { { "vhost-vsock-device", QEMU_CAPS_DEVICE_VHOST_VSOCK }, { "mch", QEMU_CAPS_DEVICE_MCH }, { "sev-guest", QEMU_CAPS_SEV_GUEST }, + { "vfio-ap", QEMU_CAPS_DEVICE_VFIO_AP }, }; static struct virQEMUCapsStringFlags virQEMUCapsDevicePropsVirtioBalloon[] = { diff --git a/src/qemu/qemu_capabilities.h b/src/qemu/qemu_capabilities.h index 934620ed31..6bb9a2c8f0 100644 --- a/src/qemu/qemu_capabilities.h +++ b/src/qemu/qemu_capabilities.h @@ -492,6 +492,7 @@ typedef enum { /* virQEMUCapsFlags grouping marker for syntax-check */ /* 315 */ QEMU_CAPS_VFIO_PCI_DISPLAY, /* -device vfio-pci.display */ QEMU_CAPS_BLOCKDEV, /* -blockdev and blockdev-add are supported */ + QEMU_CAPS_DEVICE_VFIO_AP, /* -device vfio-ap */ QEMU_CAPS_LAST /* this must always be the last item */ } virQEMUCapsFlags; -- 2.17.0

On 2018-10-18 16:54, Boris Fiuczynski wrote:
Introduce vfio-ap capability.
Signed-off-by: Boris Fiuczynski <fiuczy@linux.ibm.com> Reviewed-by: Bjoern Walk <bwalk@linux.ibm.com> --- src/qemu/qemu_capabilities.c | 2 ++ src/qemu/qemu_capabilities.h | 1 + 2 files changed, 3 insertions(+)
diff --git a/src/qemu/qemu_capabilities.c b/src/qemu/qemu_capabilities.c index e228f52ec0..2ca5af3297 100644 --- a/src/qemu/qemu_capabilities.c +++ b/src/qemu/qemu_capabilities.c @@ -508,6 +508,7 @@ VIR_ENUM_IMPL(virQEMUCaps, QEMU_CAPS_LAST, /* 315 */ "vfio-pci.display", "blockdev", + "vfio-ap", );
@@ -1092,6 +1093,7 @@ struct virQEMUCapsStringFlags virQEMUCapsObjectTypes[] = { { "vhost-vsock-device", QEMU_CAPS_DEVICE_VHOST_VSOCK }, { "mch", QEMU_CAPS_DEVICE_MCH }, { "sev-guest", QEMU_CAPS_SEV_GUEST }, + { "vfio-ap", QEMU_CAPS_DEVICE_VFIO_AP }, };
static struct virQEMUCapsStringFlags virQEMUCapsDevicePropsVirtioBalloon[] = { diff --git a/src/qemu/qemu_capabilities.h b/src/qemu/qemu_capabilities.h index 934620ed31..6bb9a2c8f0 100644 --- a/src/qemu/qemu_capabilities.h +++ b/src/qemu/qemu_capabilities.h @@ -492,6 +492,7 @@ typedef enum { /* virQEMUCapsFlags grouping marker for syntax-check */ /* 315 */ QEMU_CAPS_VFIO_PCI_DISPLAY, /* -device vfio-pci.display */ QEMU_CAPS_BLOCKDEV, /* -blockdev and blockdev-add are supported */ + QEMU_CAPS_DEVICE_VFIO_AP, /* -device vfio-ap */
QEMU_CAPS_LAST /* this must always be the last item */ } virQEMUCapsFlags;
Reviewed-by: Thomas Huth <thuth@redhat.com>

Quoting Thomas Huth (2018-10-19 06:58:34)
On 2018-10-18 16:54, Boris Fiuczynski wrote:
Introduce vfio-ap capability.
Signed-off-by: Boris Fiuczynski <fiuczy@linux.ibm.com> Reviewed-by: Bjoern Walk <bwalk@linux.ibm.com> --- src/qemu/qemu_capabilities.c | 2 ++ src/qemu/qemu_capabilities.h | 1 + 2 files changed, 3 insertions(+)
diff --git a/src/qemu/qemu_capabilities.c b/src/qemu/qemu_capabilities.c index e228f52ec0..2ca5af3297 100644 --- a/src/qemu/qemu_capabilities.c +++ b/src/qemu/qemu_capabilities.c @@ -508,6 +508,7 @@ VIR_ENUM_IMPL(virQEMUCaps, QEMU_CAPS_LAST, /* 315 */ "vfio-pci.display", "blockdev", + "vfio-ap", );
The statement "On s390, we have cryptographic coprocessor cards, which are modeled on Linux as devices on the AP bus." was made in email titled "s390: vfio-ap: guest dedicated crypto adapters" Does this imply other devices can exist on an AP Bus? Any chance this should be something like "vfio-ap.crypto" in the same way a "vfio-pci.display" entry is listed above seemingly implying a display device on a more generic pci bus? Or does "vfio-ap" always imply crypto? Having difficulty sorting out the relationships between adjunct processor, crypto processor and ap bus from the patch docs and initial review of the references.
@@ -1092,6 +1093,7 @@ struct virQEMUCapsStringFlags virQEMUCapsObjectTypes[] = { { "vhost-vsock-device", QEMU_CAPS_DEVICE_VHOST_VSOCK }, { "mch", QEMU_CAPS_DEVICE_MCH }, { "sev-guest", QEMU_CAPS_SEV_GUEST }, + { "vfio-ap", QEMU_CAPS_DEVICE_VFIO_AP }, };
static struct virQEMUCapsStringFlags virQEMUCapsDevicePropsVirtioBalloon[] = { diff --git a/src/qemu/qemu_capabilities.h b/src/qemu/qemu_capabilities.h index 934620ed31..6bb9a2c8f0 100644 --- a/src/qemu/qemu_capabilities.h +++ b/src/qemu/qemu_capabilities.h @@ -492,6 +492,7 @@ typedef enum { /* virQEMUCapsFlags grouping marker for syntax-check */ /* 315 */ QEMU_CAPS_VFIO_PCI_DISPLAY, /* -device vfio-pci.display */ QEMU_CAPS_BLOCKDEV, /* -blockdev and blockdev-add are supported */ + QEMU_CAPS_DEVICE_VFIO_AP, /* -device vfio-ap */
QEMU_CAPS_LAST /* this must always be the last item */ } virQEMUCapsFlags;
Reviewed-by: Thomas Huth <thuth@redhat.com>
-- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list

On 10/25/18 5:17 AM, Chris Venteicher wrote:
Quoting Thomas Huth (2018-10-19 06:58:34)
On 2018-10-18 16:54, Boris Fiuczynski wrote:
Introduce vfio-ap capability.
Signed-off-by: Boris Fiuczynski <fiuczy@linux.ibm.com> Reviewed-by: Bjoern Walk <bwalk@linux.ibm.com> --- src/qemu/qemu_capabilities.c | 2 ++ src/qemu/qemu_capabilities.h | 1 + 2 files changed, 3 insertions(+)
diff --git a/src/qemu/qemu_capabilities.c b/src/qemu/qemu_capabilities.c index e228f52ec0..2ca5af3297 100644 --- a/src/qemu/qemu_capabilities.c +++ b/src/qemu/qemu_capabilities.c @@ -508,6 +508,7 @@ VIR_ENUM_IMPL(virQEMUCaps, QEMU_CAPS_LAST, /* 315 */ "vfio-pci.display", "blockdev", + "vfio-ap", );
The statement "On s390, we have cryptographic coprocessor cards, which are modeled on Linux as devices on the AP bus." was made in email titled "s390: vfio-ap: guest dedicated crypto adapters"
Patch 6 of the qemu patch series (https://lists.gnu.org/archive/html/qemu-devel/2018-10/msg01997.html) has a very detailed documentation (docs/vfio-ap.txt) covering IBM Adjunct Processor (AP) Cryptographic Facility.
Does this imply other devices can exist on an AP Bus? The AP bus is a linux construct used to represent the cryptographic devices available via the Adjunct Processor Cryptographic Facility. This implies even so there are different cards they all are crypto cards.
Any chance this should be something like "vfio-ap.crypto" in the same way a "vfio-pci.display" entry is listed above seemingly implying a display device on a more generic pci bus? Or does "vfio-ap" always imply crypto?
Yes, it always is crypto only. Actually a vfio-ap mediated device is used to specify the configuration of the ap bus including all cards, usage domains and control domains passed into a qemu guest.
Having difficulty sorting out the relationships between adjunct processor, crypto processor and ap bus from the patch docs and initial review of the references.
Maybe the KVM forum session of Halil Pasic can help a bit...? https://events.linuxfoundation.org/wp-content/uploads/2017/12/vfio-ap-The-Pe...
@@ -1092,6 +1093,7 @@ struct virQEMUCapsStringFlags virQEMUCapsObjectTypes[] = { { "vhost-vsock-device", QEMU_CAPS_DEVICE_VHOST_VSOCK }, { "mch", QEMU_CAPS_DEVICE_MCH }, { "sev-guest", QEMU_CAPS_SEV_GUEST }, + { "vfio-ap", QEMU_CAPS_DEVICE_VFIO_AP }, };
static struct virQEMUCapsStringFlags virQEMUCapsDevicePropsVirtioBalloon[] = { diff --git a/src/qemu/qemu_capabilities.h b/src/qemu/qemu_capabilities.h index 934620ed31..6bb9a2c8f0 100644 --- a/src/qemu/qemu_capabilities.h +++ b/src/qemu/qemu_capabilities.h @@ -492,6 +492,7 @@ typedef enum { /* virQEMUCapsFlags grouping marker for syntax-check */ /* 315 */ QEMU_CAPS_VFIO_PCI_DISPLAY, /* -device vfio-pci.display */ QEMU_CAPS_BLOCKDEV, /* -blockdev and blockdev-add are supported */ + QEMU_CAPS_DEVICE_VFIO_AP, /* -device vfio-ap */
QEMU_CAPS_LAST /* this must always be the last item */ } virQEMUCapsFlags;
Reviewed-by: Thomas Huth <thuth@redhat.com>
-- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list
-- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list
-- Mit freundlichen Grüßen/Kind regards Boris Fiuczynski IBM Deutschland Research & Development GmbH Vorsitzender des Aufsichtsrats: Martina Köderitz Geschäftsführung: Dirk Wittkopp Sitz der Gesellschaft: Böblingen Registergericht: Amtsgericht Stuttgart, HRB 243294

On 10/25/18 1:54 PM, Boris Fiuczynski wrote:
On 10/25/18 5:17 AM, Chris Venteicher wrote:
Quoting Thomas Huth (2018-10-19 06:58:34)
On 2018-10-18 16:54, Boris Fiuczynski wrote:
Introduce vfio-ap capability.
Signed-off-by: Boris Fiuczynski <fiuczy@linux.ibm.com> Reviewed-by: Bjoern Walk <bwalk@linux.ibm.com> --- src/qemu/qemu_capabilities.c | 2 ++ src/qemu/qemu_capabilities.h | 1 + 2 files changed, 3 insertions(+)
diff --git a/src/qemu/qemu_capabilities.c b/src/qemu/qemu_capabilities.c index e228f52ec0..2ca5af3297 100644 --- a/src/qemu/qemu_capabilities.c +++ b/src/qemu/qemu_capabilities.c @@ -508,6 +508,7 @@ VIR_ENUM_IMPL(virQEMUCaps, QEMU_CAPS_LAST, /* 315 */ "vfio-pci.display", "blockdev", + "vfio-ap", );
The statement "On s390, we have cryptographic coprocessor cards, which are modeled on Linux as devices on the AP bus." was made in email titled "s390: vfio-ap: guest dedicated crypto adapters"
Patch 6 of the qemu patch series (https://lists.gnu.org/archive/html/qemu-devel/2018-10/msg01997.html) has a very detailed documentation (docs/vfio-ap.txt) covering IBM Adjunct Processor (AP) Cryptographic Facility.
Does this imply other devices can exist on an AP Bus? The AP bus is a linux construct used to represent the cryptographic devices available via the Adjunct Processor Cryptographic Facility. This implies even so there are different cards they all are crypto cards.
Any chance this should be something like "vfio-ap.crypto" in the same way a "vfio-pci.display" entry is listed above seemingly implying a display device on a more generic pci bus? Or does "vfio-ap" always imply crypto?
Yes, it always is crypto only. Actually a vfio-ap mediated device is used to specify the configuration of the ap bus including all cards, usage domains and control domains passed into a qemu guest.
Having difficulty sorting out the relationships between adjunct processor, crypto processor and ap bus from the patch docs and initial review of the references.
Maybe the KVM forum session of Halil Pasic can help a bit...? https://events.linuxfoundation.org/wp-content/uploads/2017/12/vfio-ap-The-Pe... Or you could have a look at "Chapter 47. Generic cryptographic device driver" here: http://public.dhe.ibm.com/software/dw/linux390/docu/l418dd35.pdf
@@ -1092,6 +1093,7 @@ struct virQEMUCapsStringFlags virQEMUCapsObjectTypes[] = { { "vhost-vsock-device", QEMU_CAPS_DEVICE_VHOST_VSOCK }, { "mch", QEMU_CAPS_DEVICE_MCH }, { "sev-guest", QEMU_CAPS_SEV_GUEST }, + { "vfio-ap", QEMU_CAPS_DEVICE_VFIO_AP }, }; static struct virQEMUCapsStringFlags virQEMUCapsDevicePropsVirtioBalloon[] = { diff --git a/src/qemu/qemu_capabilities.h b/src/qemu/qemu_capabilities.h index 934620ed31..6bb9a2c8f0 100644 --- a/src/qemu/qemu_capabilities.h +++ b/src/qemu/qemu_capabilities.h @@ -492,6 +492,7 @@ typedef enum { /* virQEMUCapsFlags grouping marker for syntax-check */ /* 315 */ QEMU_CAPS_VFIO_PCI_DISPLAY, /* -device vfio-pci.display */ QEMU_CAPS_BLOCKDEV, /* -blockdev and blockdev-add are supported */ + QEMU_CAPS_DEVICE_VFIO_AP, /* -device vfio-ap */ QEMU_CAPS_LAST /* this must always be the last item */ } virQEMUCapsFlags;
Reviewed-by: Thomas Huth <thuth@redhat.com>
-- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list
-- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list
-- Mit freundlichen Grüßen/Kind regards Boris Fiuczynski IBM Deutschland Research & Development GmbH Vorsitzender des Aufsichtsrats: Martina Köderitz Geschäftsführung: Dirk Wittkopp Sitz der Gesellschaft: Böblingen Registergericht: Amtsgericht Stuttgart, HRB 243294

Quoting Boris Fiuczynski (2018-10-25 07:35:44)
On 10/25/18 1:54 PM, Boris Fiuczynski wrote:
On 10/25/18 5:17 AM, Chris Venteicher wrote:
Quoting Thomas Huth (2018-10-19 06:58:34)
On 2018-10-18 16:54, Boris Fiuczynski wrote:
Introduce vfio-ap capability.
Signed-off-by: Boris Fiuczynski <fiuczy@linux.ibm.com> Reviewed-by: Bjoern Walk <bwalk@linux.ibm.com> --- src/qemu/qemu_capabilities.c | 2 ++ src/qemu/qemu_capabilities.h | 1 + 2 files changed, 3 insertions(+)
diff --git a/src/qemu/qemu_capabilities.c b/src/qemu/qemu_capabilities.c index e228f52ec0..2ca5af3297 100644 --- a/src/qemu/qemu_capabilities.c +++ b/src/qemu/qemu_capabilities.c @@ -508,6 +508,7 @@ VIR_ENUM_IMPL(virQEMUCaps, QEMU_CAPS_LAST, /* 315 */ "vfio-pci.display", "blockdev", + "vfio-ap", );
The statement "On s390, we have cryptographic coprocessor cards, which are modeled on Linux as devices on the AP bus." was made in email titled "s390: vfio-ap: guest dedicated crypto adapters"
Patch 6 of the qemu patch series (https://lists.gnu.org/archive/html/qemu-devel/2018-10/msg01997.html) has a very detailed documentation (docs/vfio-ap.txt) covering IBM Adjunct Processor (AP) Cryptographic Facility.
Does this imply other devices can exist on an AP Bus? The AP bus is a linux construct used to represent the cryptographic devices available via the Adjunct Processor Cryptographic Facility. This implies even so there are different cards they all are crypto cards.
Any chance this should be something like "vfio-ap.crypto" in the same way a "vfio-pci.display" entry is listed above seemingly implying a display device on a more generic pci bus? Or does "vfio-ap" always imply crypto?
Yes, it always is crypto only. Actually a vfio-ap mediated device is used to specify the configuration of the ap bus including all cards, usage domains and control domains passed into a qemu guest.
Having difficulty sorting out the relationships between adjunct processor, crypto processor and ap bus from the patch docs and initial review of the references.
Maybe the KVM forum session of Halil Pasic can help a bit...? https://events.linuxfoundation.org/wp-content/uploads/2017/12/vfio-ap-The-Pe... Or you could have a look at "Chapter 47. Generic cryptographic device driver" here: http://public.dhe.ibm.com/software/dw/linux390/docu/l418dd35.pdf
Thanks for the info. The Halil 2018 doc was good for orienting. Can't say I understand the details but I don't see problems in the source code it's self. Reviewed-by: Chris Venteicher <cventeic@redhat.com>
@@ -1092,6 +1093,7 @@ struct virQEMUCapsStringFlags virQEMUCapsObjectTypes[] = { { "vhost-vsock-device", QEMU_CAPS_DEVICE_VHOST_VSOCK }, { "mch", QEMU_CAPS_DEVICE_MCH }, { "sev-guest", QEMU_CAPS_SEV_GUEST }, + { "vfio-ap", QEMU_CAPS_DEVICE_VFIO_AP }, }; static struct virQEMUCapsStringFlags virQEMUCapsDevicePropsVirtioBalloon[] = { diff --git a/src/qemu/qemu_capabilities.h b/src/qemu/qemu_capabilities.h index 934620ed31..6bb9a2c8f0 100644 --- a/src/qemu/qemu_capabilities.h +++ b/src/qemu/qemu_capabilities.h @@ -492,6 +492,7 @@ typedef enum { /* virQEMUCapsFlags grouping marker for syntax-check */ /* 315 */ QEMU_CAPS_VFIO_PCI_DISPLAY, /* -device vfio-pci.display */ QEMU_CAPS_BLOCKDEV, /* -blockdev and blockdev-add are supported */ + QEMU_CAPS_DEVICE_VFIO_AP, /* -device vfio-ap */ QEMU_CAPS_LAST /* this must always be the last item */ } virQEMUCapsFlags;
Reviewed-by: Thomas Huth <thuth@redhat.com>
-- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list
-- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list
-- Mit freundlichen Grüßen/Kind regards Boris Fiuczynski
IBM Deutschland Research & Development GmbH Vorsitzender des Aufsichtsrats: Martina Köderitz Geschäftsführung: Dirk Wittkopp Sitz der Gesellschaft: Böblingen Registergericht: Amtsgericht Stuttgart, HRB 243294

Adjusting domain format documentation, adding device address support and adding command line generation for vfio-ap. Since only one mediated hostdev with model vfio-ap is supported a check disallows to define domains with more than one such hostdev device. Signed-off-by: Boris Fiuczynski <fiuczy@linux.ibm.com> Reviewed-by: Bjoern Walk <bwalk@linux.ibm.com> --- docs/formatdomain.html.in | 3 ++- docs/schemas/domaincommon.rng | 1 + src/conf/domain_conf.c | 28 ++++++++++++++++++++++++++++ src/qemu/qemu_command.c | 8 ++++++++ src/qemu/qemu_domain_address.c | 4 ++++ src/util/virmdev.c | 3 ++- src/util/virmdev.h | 1 + 7 files changed, 46 insertions(+), 2 deletions(-) diff --git a/docs/formatdomain.html.in b/docs/formatdomain.html.in index 8189959773..269741a690 100644 --- a/docs/formatdomain.html.in +++ b/docs/formatdomain.html.in @@ -4616,8 +4616,9 @@ <dd>For mediated devices (<span class="since">Since 3.2.0</span>) the <code>model</code> attribute specifies the device API which determines how the host's vfio driver will expose the device to the - guest. Currently, <code>model='vfio-pci'</code> and + guest. Currently, <code>model='vfio-pci'</code>, <code>model='vfio-ccw'</code> (<span class="since">Since 4.4.0</span>) + and <code>model='vfio-ap'</code> (<span class="since">Since 4.9.0</span>) is supported. <a href="drvnodedev.html#MDEV">MDEV</a> section provides more information about mediated devices as well as how to create mediated devices on the host. diff --git a/docs/schemas/domaincommon.rng b/docs/schemas/domaincommon.rng index 099a949cf8..b9ac5df479 100644 --- a/docs/schemas/domaincommon.rng +++ b/docs/schemas/domaincommon.rng @@ -4618,6 +4618,7 @@ <choice> <value>vfio-pci</value> <value>vfio-ccw</value> + <value>vfio-ap</value> </choice> </attribute> <optional> diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c index e8e0adc819..1f8797f997 100644 --- a/src/conf/domain_conf.c +++ b/src/conf/domain_conf.c @@ -4275,6 +4275,31 @@ virDomainDefPostParseGraphics(virDomainDef *def) } +static int +virDomainDefPostParseHostdev(virDomainDefPtr def) +{ + size_t i; + bool vfioap_found = false; + + /* verify settings of hostdevs vfio-ap */ + for (i = 0; i < def->nhostdevs; i++) { + virDomainHostdevDefPtr hostdev = def->hostdevs[i]; + + if (virHostdevIsMdevDevice(hostdev) && + hostdev->source.subsys.u.mdev.model == VIR_MDEV_MODEL_TYPE_VFIO_AP) { + if (vfioap_found) { + virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", + _("Only one hostdev of model vfio-ap is " + "support")); + return -1; + } + vfioap_found = true; + } + } + return 0; +} + + /** * virDomainDriveAddressIsUsedByDisk: * @def: domain definition containing the disks to check @@ -5185,6 +5210,9 @@ virDomainDefPostParseCommon(virDomainDefPtr def, virDomainDefPostParseGraphics(def); + if (virDomainDefPostParseHostdev(def) < 0) + return -1; + if (virDomainDefPostParseCPU(def) < 0) return -1; diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c index 1ff593c657..6e3ff67660 100644 --- a/src/qemu/qemu_command.c +++ b/src/qemu/qemu_command.c @@ -5476,6 +5476,14 @@ qemuBuildHostdevCommandLine(virCommandPtr cmd, return -1; } break; + case VIR_MDEV_MODEL_TYPE_VFIO_AP: + if (!virQEMUCapsGet(qemuCaps, QEMU_CAPS_DEVICE_VFIO_AP)) { + virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", + _("VFIO AP device assignment is not " + "supported by this version of QEMU")); + return -1; + } + break; case VIR_MDEV_MODEL_TYPE_LAST: default: virReportEnumRangeError(virMediatedDeviceModelType, diff --git a/src/qemu/qemu_domain_address.c b/src/qemu/qemu_domain_address.c index 8a8764cff5..24dd7c1a58 100644 --- a/src/qemu/qemu_domain_address.c +++ b/src/qemu/qemu_domain_address.c @@ -294,6 +294,10 @@ qemuDomainPrimeVfioDeviceAddresses(virDomainDefPtr def, subsys->u.mdev.model == VIR_MDEV_MODEL_TYPE_VFIO_CCW && def->hostdevs[i]->info->type == VIR_DOMAIN_DEVICE_ADDRESS_TYPE_NONE) def->hostdevs[i]->info->type = type; + + if (virHostdevIsMdevDevice(def->hostdevs[i]) && + subsys->u.mdev.model == VIR_MDEV_MODEL_TYPE_VFIO_AP) + def->hostdevs[i]->info->type = VIR_DOMAIN_DEVICE_ADDRESS_TYPE_NONE; } } diff --git a/src/util/virmdev.c b/src/util/virmdev.c index 10a2b08337..3e11e38802 100644 --- a/src/util/virmdev.c +++ b/src/util/virmdev.c @@ -48,7 +48,8 @@ struct _virMediatedDeviceList { VIR_ENUM_IMPL(virMediatedDeviceModel, VIR_MDEV_MODEL_TYPE_LAST, "vfio-pci", - "vfio-ccw") + "vfio-ccw", + "vfio-ap") static virClassPtr virMediatedDeviceListClass; diff --git a/src/util/virmdev.h b/src/util/virmdev.h index 7c93c4d390..c856ff5bdb 100644 --- a/src/util/virmdev.h +++ b/src/util/virmdev.h @@ -27,6 +27,7 @@ typedef enum { VIR_MDEV_MODEL_TYPE_VFIO_PCI = 0, VIR_MDEV_MODEL_TYPE_VFIO_CCW = 1, + VIR_MDEV_MODEL_TYPE_VFIO_AP = 2, VIR_MDEV_MODEL_TYPE_LAST } virMediatedDeviceModelType; -- 2.17.0

On 2018-10-18 16:54, Boris Fiuczynski wrote:
Adjusting domain format documentation, adding device address support and adding command line generation for vfio-ap. Since only one mediated hostdev with model vfio-ap is supported a check disallows to define domains with more than one such hostdev device.
Signed-off-by: Boris Fiuczynski <fiuczy@linux.ibm.com> Reviewed-by: Bjoern Walk <bwalk@linux.ibm.com> [...] +static int +virDomainDefPostParseHostdev(virDomainDefPtr def) +{ + size_t i; + bool vfioap_found = false; + + /* verify settings of hostdevs vfio-ap */ + for (i = 0; i < def->nhostdevs; i++) { + virDomainHostdevDefPtr hostdev = def->hostdevs[i]; + + if (virHostdevIsMdevDevice(hostdev) && + hostdev->source.subsys.u.mdev.model == VIR_MDEV_MODEL_TYPE_VFIO_AP) { + if (vfioap_found) { + virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", + _("Only one hostdev of model vfio-ap is " + "support"));
s/support/supported/ ? Thomas

On 10/19/18 1:56 PM, Thomas Huth wrote:
On 2018-10-18 16:54, Boris Fiuczynski wrote:
Adjusting domain format documentation, adding device address support and adding command line generation for vfio-ap. Since only one mediated hostdev with model vfio-ap is supported a check disallows to define domains with more than one such hostdev device.
Signed-off-by: Boris Fiuczynski <fiuczy@linux.ibm.com> Reviewed-by: Bjoern Walk <bwalk@linux.ibm.com> [...] +static int +virDomainDefPostParseHostdev(virDomainDefPtr def) +{ + size_t i; + bool vfioap_found = false; + + /* verify settings of hostdevs vfio-ap */ + for (i = 0; i < def->nhostdevs; i++) { + virDomainHostdevDefPtr hostdev = def->hostdevs[i]; + + if (virHostdevIsMdevDevice(hostdev) && + hostdev->source.subsys.u.mdev.model == VIR_MDEV_MODEL_TYPE_VFIO_AP) { + if (vfioap_found) { + virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", + _("Only one hostdev of model vfio-ap is " + "support"));
s/support/supported/ ? It should be "supported"... :-)
I hope whoever is going to push this series can fix it before pushing. If not please let me know and I am going to send a v3. Thomas, thanks for your review.
Thomas
-- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list
-- Mit freundlichen Grüßen/Kind regards Boris Fiuczynski IBM Deutschland Research & Development GmbH Vorsitzender des Aufsichtsrats: Martina Köderitz Geschäftsführung: Dirk Wittkopp Sitz der Gesellschaft: Böblingen Registergericht: Amtsgericht Stuttgart, HRB 243294

On Mon, Oct 22, 2018 at 10:10:39AM +0200, Boris Fiuczynski wrote:
On 10/19/18 1:56 PM, Thomas Huth wrote:
On 2018-10-18 16:54, Boris Fiuczynski wrote:
Adjusting domain format documentation, adding device address support and adding command line generation for vfio-ap. Since only one mediated hostdev with model vfio-ap is supported a check disallows to define domains with more than one such hostdev device.
Signed-off-by: Boris Fiuczynski <fiuczy@linux.ibm.com> Reviewed-by: Bjoern Walk <bwalk@linux.ibm.com> [...] +static int +virDomainDefPostParseHostdev(virDomainDefPtr def) +{ + size_t i; + bool vfioap_found = false; + + /* verify settings of hostdevs vfio-ap */ + for (i = 0; i < def->nhostdevs; i++) { + virDomainHostdevDefPtr hostdev = def->hostdevs[i]; + + if (virHostdevIsMdevDevice(hostdev) && + hostdev->source.subsys.u.mdev.model == VIR_MDEV_MODEL_TYPE_VFIO_AP) { + if (vfioap_found) { + virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", + _("Only one hostdev of model vfio-ap is " + "support"));
s/support/supported/ ? It should be "supported"... :-)
I hope whoever is going to push this series can fix it before pushing. If not please let me know and I am going to send a v3.
Hi Boris, I'm planning on having a look at the series too (sorry for not taking a look earlier, I was on PTO and the whole team is now attending KVM forum). Anyhow, if it turns out the typo is the only issue, that will be fixed before merging, no brainer :). Erik

Hi Erik, do you think it is possible that this series gets into v4.9.0? Cheers, Boris On 10/24/18 12:18 AM, Erik Skultety wrote:
On Mon, Oct 22, 2018 at 10:10:39AM +0200, Boris Fiuczynski wrote:
On 10/19/18 1:56 PM, Thomas Huth wrote:
On 2018-10-18 16:54, Boris Fiuczynski wrote:
Adjusting domain format documentation, adding device address support and adding command line generation for vfio-ap. Since only one mediated hostdev with model vfio-ap is supported a check disallows to define domains with more than one such hostdev device.
Signed-off-by: Boris Fiuczynski <fiuczy@linux.ibm.com> Reviewed-by: Bjoern Walk <bwalk@linux.ibm.com> [...] +static int +virDomainDefPostParseHostdev(virDomainDefPtr def) +{ + size_t i; + bool vfioap_found = false; + + /* verify settings of hostdevs vfio-ap */ + for (i = 0; i < def->nhostdevs; i++) { + virDomainHostdevDefPtr hostdev = def->hostdevs[i]; + + if (virHostdevIsMdevDevice(hostdev) && + hostdev->source.subsys.u.mdev.model == VIR_MDEV_MODEL_TYPE_VFIO_AP) { + if (vfioap_found) { + virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", + _("Only one hostdev of model vfio-ap is " + "support"));
s/support/supported/ ? It should be "supported"... :-)
I hope whoever is going to push this series can fix it before pushing. If not please let me know and I am going to send a v3.
Hi Boris, I'm planning on having a look at the series too (sorry for not taking a look earlier, I was on PTO and the whole team is now attending KVM forum). Anyhow, if it turns out the typo is the only issue, that will be fixed before merging, no brainer :).
Erik
-- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list
-- Mit freundlichen Grüßen/Kind regards Boris Fiuczynski IBM Deutschland Research & Development GmbH Vorsitzender des Aufsichtsrats: Martina Köderitz Geschäftsführung: Dirk Wittkopp Sitz der Gesellschaft: Böblingen Registergericht: Amtsgericht Stuttgart, HRB 243294

On 10/29/18 11:54 AM, Boris Fiuczynski wrote:
Hi Erik, do you think it is possible that this series gets into v4.9.0?
Cheers, Boris
Not sure if Erik is "online" today... The Red Hat portion of the team has just returned from KVM Forum and today we have some well larger news to digest too ;-) In any case, I had it on my radar too... When I last looked patch2 didn't have Thomas' explicit R-By, but it has others so that's fine. Just have to go through the "motions" and will push before release... John
On 10/24/18 12:18 AM, Erik Skultety wrote:
On Mon, Oct 22, 2018 at 10:10:39AM +0200, Boris Fiuczynski wrote:
On 10/19/18 1:56 PM, Thomas Huth wrote:
On 2018-10-18 16:54, Boris Fiuczynski wrote:
Adjusting domain format documentation, adding device address support and adding command line generation for vfio-ap. Since only one mediated hostdev with model vfio-ap is supported a check disallows to define domains with more than one such hostdev device.
Signed-off-by: Boris Fiuczynski <fiuczy@linux.ibm.com> Reviewed-by: Bjoern Walk <bwalk@linux.ibm.com> [...] +static int +virDomainDefPostParseHostdev(virDomainDefPtr def) +{ + size_t i; + bool vfioap_found = false; + + /* verify settings of hostdevs vfio-ap */ + for (i = 0; i < def->nhostdevs; i++) { + virDomainHostdevDefPtr hostdev = def->hostdevs[i]; + + if (virHostdevIsMdevDevice(hostdev) && + hostdev->source.subsys.u.mdev.model == VIR_MDEV_MODEL_TYPE_VFIO_AP) { + if (vfioap_found) { + virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", + _("Only one hostdev of model vfio-ap is " + "support"));
s/support/supported/ ? It should be "supported"... :-)
I hope whoever is going to push this series can fix it before pushing. If not please let me know and I am going to send a v3.
Hi Boris, I'm planning on having a look at the series too (sorry for not taking a look earlier, I was on PTO and the whole team is now attending KVM forum). Anyhow, if it turns out the typo is the only issue, that will be fixed before merging, no brainer :).
Erik
-- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list

Quoting Boris Fiuczynski (2018-10-18 09:54:07)
Adjusting domain format documentation, adding device address support and adding command line generation for vfio-ap. Since only one mediated hostdev with model vfio-ap is supported a check disallows to define domains with more than one such hostdev device.
Signed-off-by: Boris Fiuczynski <fiuczy@linux.ibm.com> Reviewed-by: Bjoern Walk <bwalk@linux.ibm.com> Reviewed-by: Chris Venteicher <cventeic@redhat.com> --- docs/formatdomain.html.in | 3 ++- docs/schemas/domaincommon.rng | 1 + src/conf/domain_conf.c | 28 ++++++++++++++++++++++++++++ src/qemu/qemu_command.c | 8 ++++++++ src/qemu/qemu_domain_address.c | 4 ++++ src/util/virmdev.c | 3 ++- src/util/virmdev.h | 1 + 7 files changed, 46 insertions(+), 2 deletions(-)
diff --git a/docs/formatdomain.html.in b/docs/formatdomain.html.in index 8189959773..269741a690 100644 --- a/docs/formatdomain.html.in +++ b/docs/formatdomain.html.in @@ -4616,8 +4616,9 @@ <dd>For mediated devices (<span class="since">Since 3.2.0</span>) the <code>model</code> attribute specifies the device API which determines how the host's vfio driver will expose the device to the - guest. Currently, <code>model='vfio-pci'</code> and + guest. Currently, <code>model='vfio-pci'</code>, <code>model='vfio-ccw'</code> (<span class="since">Since 4.4.0</span>) + and <code>model='vfio-ap'</code> (<span class="since">Since 4.9.0</span>) is supported. <a href="drvnodedev.html#MDEV">MDEV</a> section provides more information about mediated devices as well as how to create mediated devices on the host. diff --git a/docs/schemas/domaincommon.rng b/docs/schemas/domaincommon.rng index 099a949cf8..b9ac5df479 100644 --- a/docs/schemas/domaincommon.rng +++ b/docs/schemas/domaincommon.rng @@ -4618,6 +4618,7 @@ <choice> <value>vfio-pci</value> <value>vfio-ccw</value> + <value>vfio-ap</value> </choice> </attribute> <optional> diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c index e8e0adc819..1f8797f997 100644 --- a/src/conf/domain_conf.c +++ b/src/conf/domain_conf.c @@ -4275,6 +4275,31 @@ virDomainDefPostParseGraphics(virDomainDef *def) }
+static int +virDomainDefPostParseHostdev(virDomainDefPtr def) +{ + size_t i; + bool vfioap_found = false; + + /* verify settings of hostdevs vfio-ap */ + for (i = 0; i < def->nhostdevs; i++) { + virDomainHostdevDefPtr hostdev = def->hostdevs[i]; + + if (virHostdevIsMdevDevice(hostdev) && + hostdev->source.subsys.u.mdev.model == VIR_MDEV_MODEL_TYPE_VFIO_AP) { + if (vfioap_found) { + virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", + _("Only one hostdev of model vfio-ap is " + "support")); + return -1; + } + vfioap_found = true; + } + } + return 0; +} + + /** * virDomainDriveAddressIsUsedByDisk: * @def: domain definition containing the disks to check @@ -5185,6 +5210,9 @@ virDomainDefPostParseCommon(virDomainDefPtr def,
virDomainDefPostParseGraphics(def);
+ if (virDomainDefPostParseHostdev(def) < 0) + return -1; + if (virDomainDefPostParseCPU(def) < 0) return -1;
diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c index 1ff593c657..6e3ff67660 100644 --- a/src/qemu/qemu_command.c +++ b/src/qemu/qemu_command.c @@ -5476,6 +5476,14 @@ qemuBuildHostdevCommandLine(virCommandPtr cmd, return -1; } break; + case VIR_MDEV_MODEL_TYPE_VFIO_AP: + if (!virQEMUCapsGet(qemuCaps, QEMU_CAPS_DEVICE_VFIO_AP)) { + virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", + _("VFIO AP device assignment is not " + "supported by this version of QEMU")); + return -1; + } + break; case VIR_MDEV_MODEL_TYPE_LAST: default: virReportEnumRangeError(virMediatedDeviceModelType, diff --git a/src/qemu/qemu_domain_address.c b/src/qemu/qemu_domain_address.c index 8a8764cff5..24dd7c1a58 100644 --- a/src/qemu/qemu_domain_address.c +++ b/src/qemu/qemu_domain_address.c @@ -294,6 +294,10 @@ qemuDomainPrimeVfioDeviceAddresses(virDomainDefPtr def, subsys->u.mdev.model == VIR_MDEV_MODEL_TYPE_VFIO_CCW && def->hostdevs[i]->info->type == VIR_DOMAIN_DEVICE_ADDRESS_TYPE_NONE) def->hostdevs[i]->info->type = type; + + if (virHostdevIsMdevDevice(def->hostdevs[i]) && + subsys->u.mdev.model == VIR_MDEV_MODEL_TYPE_VFIO_AP) + def->hostdevs[i]->info->type = VIR_DOMAIN_DEVICE_ADDRESS_TYPE_NONE;
Is there a case where a VFIO_AP hostdev is of a type other than the default type (value 0) VIR_DOMAIN_DEVICE_ADDRESS_TYPE_NONE such that this code actually changes the type? Don't think it's an error but not sure it's actually needed.
} }
diff --git a/src/util/virmdev.c b/src/util/virmdev.c index 10a2b08337..3e11e38802 100644 --- a/src/util/virmdev.c +++ b/src/util/virmdev.c @@ -48,7 +48,8 @@ struct _virMediatedDeviceList {
VIR_ENUM_IMPL(virMediatedDeviceModel, VIR_MDEV_MODEL_TYPE_LAST, "vfio-pci", - "vfio-ccw") + "vfio-ccw", + "vfio-ap")
static virClassPtr virMediatedDeviceListClass;
diff --git a/src/util/virmdev.h b/src/util/virmdev.h index 7c93c4d390..c856ff5bdb 100644 --- a/src/util/virmdev.h +++ b/src/util/virmdev.h @@ -27,6 +27,7 @@ typedef enum { VIR_MDEV_MODEL_TYPE_VFIO_PCI = 0, VIR_MDEV_MODEL_TYPE_VFIO_CCW = 1, + VIR_MDEV_MODEL_TYPE_VFIO_AP = 2,
VIR_MDEV_MODEL_TYPE_LAST } virMediatedDeviceModelType; -- 2.17.0
-- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list

Quoting Boris Fiuczynski (2018-10-18 09:54:07)
Adjusting domain format documentation, adding device address support and adding command line generation for vfio-ap. Since only one mediated hostdev with model vfio-ap is supported a check disallows to define domains with more than one such hostdev device.
Signed-off-by: Boris Fiuczynski <fiuczy@linux.ibm.com> Reviewed-by: Bjoern Walk <bwalk@linux.ibm.com> Reviewed-by: Chris Venteicher <cventeic@redhat.com> --- docs/formatdomain.html.in | 3 ++- docs/schemas/domaincommon.rng | 1 + src/conf/domain_conf.c | 28 ++++++++++++++++++++++++++++ src/qemu/qemu_command.c | 8 ++++++++ src/qemu/qemu_domain_address.c | 4 ++++ src/util/virmdev.c | 3 ++- src/util/virmdev.h | 1 + 7 files changed, 46 insertions(+), 2 deletions(-)
diff --git a/docs/formatdomain.html.in b/docs/formatdomain.html.in index 8189959773..269741a690 100644 --- a/docs/formatdomain.html.in +++ b/docs/formatdomain.html.in @@ -4616,8 +4616,9 @@ <dd>For mediated devices (<span class="since">Since 3.2.0</span>) the <code>model</code> attribute specifies the device API which determines how the host's vfio driver will expose the device to the - guest. Currently, <code>model='vfio-pci'</code> and + guest. Currently, <code>model='vfio-pci'</code>, <code>model='vfio-ccw'</code> (<span class="since">Since 4.4.0</span>) + and <code>model='vfio-ap'</code> (<span class="since">Since 4.9.0</span>) is supported. <a href="drvnodedev.html#MDEV">MDEV</a> section provides more information about mediated devices as well as how to create mediated devices on the host. diff --git a/docs/schemas/domaincommon.rng b/docs/schemas/domaincommon.rng index 099a949cf8..b9ac5df479 100644 --- a/docs/schemas/domaincommon.rng +++ b/docs/schemas/domaincommon.rng @@ -4618,6 +4618,7 @@ <choice> <value>vfio-pci</value> <value>vfio-ccw</value> + <value>vfio-ap</value> </choice> </attribute> <optional> diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c index e8e0adc819..1f8797f997 100644 --- a/src/conf/domain_conf.c +++ b/src/conf/domain_conf.c @@ -4275,6 +4275,31 @@ virDomainDefPostParseGraphics(virDomainDef *def) }
+static int +virDomainDefPostParseHostdev(virDomainDefPtr def) +{ + size_t i; + bool vfioap_found = false; + + /* verify settings of hostdevs vfio-ap */ + for (i = 0; i < def->nhostdevs; i++) { + virDomainHostdevDefPtr hostdev = def->hostdevs[i]; + + if (virHostdevIsMdevDevice(hostdev) && + hostdev->source.subsys.u.mdev.model == VIR_MDEV_MODEL_TYPE_VFIO_AP) { + if (vfioap_found) { + virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", + _("Only one hostdev of model vfio-ap is " + "support")); + return -1; + } + vfioap_found = true; + } + } + return 0; +} + + /** * virDomainDriveAddressIsUsedByDisk: * @def: domain definition containing the disks to check @@ -5185,6 +5210,9 @@ virDomainDefPostParseCommon(virDomainDefPtr def,
virDomainDefPostParseGraphics(def);
+ if (virDomainDefPostParseHostdev(def) < 0) + return -1; + if (virDomainDefPostParseCPU(def) < 0) return -1;
diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c index 1ff593c657..6e3ff67660 100644 --- a/src/qemu/qemu_command.c +++ b/src/qemu/qemu_command.c @@ -5476,6 +5476,14 @@ qemuBuildHostdevCommandLine(virCommandPtr cmd, return -1; } break; + case VIR_MDEV_MODEL_TYPE_VFIO_AP: + if (!virQEMUCapsGet(qemuCaps, QEMU_CAPS_DEVICE_VFIO_AP)) { + virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", + _("VFIO AP device assignment is not " + "supported by this version of QEMU")); + return -1; + } + break; case VIR_MDEV_MODEL_TYPE_LAST: default: virReportEnumRangeError(virMediatedDeviceModelType, diff --git a/src/qemu/qemu_domain_address.c b/src/qemu/qemu_domain_address.c index 8a8764cff5..24dd7c1a58 100644 --- a/src/qemu/qemu_domain_address.c +++ b/src/qemu/qemu_domain_address.c @@ -294,6 +294,10 @@ qemuDomainPrimeVfioDeviceAddresses(virDomainDefPtr def, subsys->u.mdev.model == VIR_MDEV_MODEL_TYPE_VFIO_CCW && def->hostdevs[i]->info->type == VIR_DOMAIN_DEVICE_ADDRESS_TYPE_NONE) def->hostdevs[i]->info->type = type; + + if (virHostdevIsMdevDevice(def->hostdevs[i]) && + subsys->u.mdev.model == VIR_MDEV_MODEL_TYPE_VFIO_AP) + def->hostdevs[i]->info->type = VIR_DOMAIN_DEVICE_ADDRESS_TYPE_NONE;
Is there a case where a VFIO_AP hostdev is of a type other than the default type (value 0) VIR_DOMAIN_DEVICE_ADDRESS_TYPE_NONE such that this code actually changes the type?
Don't think it's an error but not sure it's actually needed. The code eliminates any address specified in a hostdev of type mdev with model vfio-ap. Since the vfio-ap mdev essentially represents the complete ap bus including all cards, usage domains and control domains
On 10/26/18 3:00 AM, Chris Venteicher wrote: there is no useful address.
} }
diff --git a/src/util/virmdev.c b/src/util/virmdev.c index 10a2b08337..3e11e38802 100644 --- a/src/util/virmdev.c +++ b/src/util/virmdev.c @@ -48,7 +48,8 @@ struct _virMediatedDeviceList {
VIR_ENUM_IMPL(virMediatedDeviceModel, VIR_MDEV_MODEL_TYPE_LAST, "vfio-pci", - "vfio-ccw") + "vfio-ccw", + "vfio-ap")
static virClassPtr virMediatedDeviceListClass;
diff --git a/src/util/virmdev.h b/src/util/virmdev.h index 7c93c4d390..c856ff5bdb 100644 --- a/src/util/virmdev.h +++ b/src/util/virmdev.h @@ -27,6 +27,7 @@ typedef enum { VIR_MDEV_MODEL_TYPE_VFIO_PCI = 0, VIR_MDEV_MODEL_TYPE_VFIO_CCW = 1, + VIR_MDEV_MODEL_TYPE_VFIO_AP = 2,
VIR_MDEV_MODEL_TYPE_LAST } virMediatedDeviceModelType; -- 2.17.0
-- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list
-- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list
-- Mit freundlichen Grüßen/Kind regards Boris Fiuczynski IBM Deutschland Research & Development GmbH Vorsitzender des Aufsichtsrats: Martina Köderitz Geschäftsführung: Dirk Wittkopp Sitz der Gesellschaft: Böblingen Registergericht: Amtsgericht Stuttgart, HRB 243294

Signed-off-by: Boris Fiuczynski <fiuczy@linux.ibm.com> --- docs/news.xml | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/docs/news.xml b/docs/news.xml index dc08c96352..e5476a3332 100644 --- a/docs/news.xml +++ b/docs/news.xml @@ -35,6 +35,15 @@ <libvirt> <release version="v4.9.0" date="unreleased"> <section title="New features"> + <change> + <summary> + qemu: Add vfio AP support + </summary> + <description> + The QEMU driver now has support to passthrough adjunct processors + into QEMU guests on S390. + </description> + </change> </section> <section title="Improvements"> </section> -- 2.17.0

On 2018-10-18 16:54, Boris Fiuczynski wrote:
Signed-off-by: Boris Fiuczynski <fiuczy@linux.ibm.com> --- docs/news.xml | 9 +++++++++ 1 file changed, 9 insertions(+)
diff --git a/docs/news.xml b/docs/news.xml index dc08c96352..e5476a3332 100644 --- a/docs/news.xml +++ b/docs/news.xml @@ -35,6 +35,15 @@ <libvirt> <release version="v4.9.0" date="unreleased"> <section title="New features"> + <change> + <summary> + qemu: Add vfio AP support + </summary> + <description> + The QEMU driver now has support to passthrough adjunct processors + into QEMU guests on S390. + </description> + </change> </section> <section title="Improvements"> </section>
Reviewed-by: Thomas Huth <thuth@redhat.com>

Quoting Thomas Huth (2018-10-19 07:19:35)
On 2018-10-18 16:54, Boris Fiuczynski wrote:
Signed-off-by: Boris Fiuczynski <fiuczy@linux.ibm.com> --- docs/news.xml | 9 +++++++++ 1 file changed, 9 insertions(+)
diff --git a/docs/news.xml b/docs/news.xml index dc08c96352..e5476a3332 100644 --- a/docs/news.xml +++ b/docs/news.xml @@ -35,6 +35,15 @@ <libvirt> <release version="v4.9.0" date="unreleased"> <section title="New features"> + <change> + <summary> + qemu: Add vfio AP support + </summary> + <description> + The QEMU driver now has support to passthrough adjunct processors + into QEMU guests on S390. + </description> + </change> </section> <section title="Improvements"> </section>
Reviewed-by: Thomas Huth <thuth@redhat.com> Reviewed-by: Chris Venteicher <cventeic@redhat.com>
-- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list

On 10/18/18 10:54 AM, Boris Fiuczynski wrote:
v2: + added singleton check for vfio-ap mediated device
This patch series introduces initial libvirt support for guest dedicated crypto adapters on S390. It allows to specify a vfio-ap mediated device in a domain. Extensive documentation about AP is available in patch 6 of the QEMU patch series.
I modified patch2 to use "supported" and pushed the series just now. Tks - John
KVM/kernel: guest dedicated crypto adapters https://lkml.org/lkml/2018/9/26/25
QEMU: s390x: vfio-ap: guest dedicated crypto adapters https://lists.gnu.org/archive/html/qemu-devel/2018-10/msg01993.html
The qemu patch series has been included into master. https://git.qemu.org/?p=qemu.git;a=commit;h=69ac8c4cb93f2685839ff7b857cef306...
Boris Fiuczynski (3): qemu: add vfio-ap capability qemu: vfio-ap device support news: Update news for vfio-ap support
docs/formatdomain.html.in | 3 ++- docs/news.xml | 9 +++++++++ docs/schemas/domaincommon.rng | 1 + src/conf/domain_conf.c | 28 ++++++++++++++++++++++++++++ src/qemu/qemu_capabilities.c | 2 ++ src/qemu/qemu_capabilities.h | 1 + src/qemu/qemu_command.c | 8 ++++++++ src/qemu/qemu_domain_address.c | 4 ++++ src/util/virmdev.c | 3 ++- src/util/virmdev.h | 1 + 10 files changed, 58 insertions(+), 2 deletions(-)

On 10/29/18 5:48 PM, John Ferlan wrote:
On 10/18/18 10:54 AM, Boris Fiuczynski wrote:
v2: + added singleton check for vfio-ap mediated device
This patch series introduces initial libvirt support for guest dedicated crypto adapters on S390. It allows to specify a vfio-ap mediated device in a domain. Extensive documentation about AP is available in patch 6 of the QEMU patch series.
I modified patch2 to use "supported" and pushed the series just now.
Tks -
John
Thanks John. I appreciate it. -- Mit freundlichen Grüßen/Kind regards Boris Fiuczynski IBM Deutschland Research & Development GmbH Vorsitzender des Aufsichtsrats: Martina Köderitz Geschäftsführung: Dirk Wittkopp Sitz der Gesellschaft: Böblingen Registergericht: Amtsgericht Stuttgart, HRB 243294
participants (5)
-
Boris Fiuczynski
-
Chris Venteicher
-
Erik Skultety
-
John Ferlan
-
Thomas Huth