Let us introduce the capability vfio-ccw for supporting the basic channel I/O passthrough, which have been introduced in QEMU 2.10. The current focus is to support dasd-eckd (cu_type/dev_type = 0x3990/0x3390) as the target device. Let us also introduce the capability QEMU_CAPS_CCW_CSSID_UNRESTRICTED for virtual-css-bridge. This capability is based on the cssid-unrestricted property which exists if QEMU no longer enforces cssid restrictions based on ccw device types. Vfio-ccw capability is dependent on the hidden virtual-css-bridge, so that we are able to probe for the cssid-unrestriced property. Signed-off-by: Shalini Chellathurai Saroja <shalini@xxxxxxxxxxxxxxxxxx> Reviewed-by: Bjoern Walk <bwalk@xxxxxxxxxxxxxxxxxx> Reviewed-by: Boris Fiuczynski <fiuczy@xxxxxxxxxxxxxxxxxx> --- src/qemu/qemu_capabilities.c | 14 ++++++++++ src/qemu/qemu_capabilities.h | 4 +++ .../qemucapabilitiesdata/caps_2.10.0.s390x.replies | 28 ++++++++++++------- tests/qemucapabilitiesdata/caps_2.10.0.s390x.xml | 2 +- .../qemucapabilitiesdata/caps_2.11.0.s390x.replies | 28 ++++++++++++------- tests/qemucapabilitiesdata/caps_2.11.0.s390x.xml | 2 +- .../qemucapabilitiesdata/caps_2.12.0.s390x.replies | 31 ++++++++++++++++------ tests/qemucapabilitiesdata/caps_2.12.0.s390x.xml | 3 +++ .../qemucapabilitiesdata/caps_2.7.0.s390x.replies | 24 ++++++++++++----- tests/qemucapabilitiesdata/caps_2.7.0.s390x.xml | 2 +- .../qemucapabilitiesdata/caps_2.8.0.s390x.replies | 28 ++++++++++++------- tests/qemucapabilitiesdata/caps_2.8.0.s390x.xml | 2 +- .../qemucapabilitiesdata/caps_2.9.0.s390x.replies | 28 ++++++++++++------- tests/qemucapabilitiesdata/caps_2.9.0.s390x.xml | 2 +- 14 files changed, 142 insertions(+), 56 deletions(-) diff --git a/src/qemu/qemu_capabilities.c b/src/qemu/qemu_capabilities.c index 719f527362..a0816de80d 100644 --- a/src/qemu/qemu_capabilities.c +++ b/src/qemu/qemu_capabilities.c @@ -469,6 +469,10 @@ VIR_ENUM_IMPL(virQEMUCaps, QEMU_CAPS_LAST, "qcow2-luks", "pcie-pci-bridge", "virtual-css-bridge", + "virtual-css-bridge.cssid-unrestricted", + + /* 290 */ + "vfio-ccw", ); @@ -1106,6 +1110,7 @@ struct virQEMUCapsStringFlags virQEMUCapsObjectTypes[] = { { "virtio-tablet-ccw", QEMU_CAPS_DEVICE_VIRTIO_TABLET_CCW }, { "pcie-pci-bridge", QEMU_CAPS_DEVICE_PCIE_PCI_BRIDGE }, { "virtual-css-bridge", QEMU_CAPS_CCW }, + { "vfio-ccw", QEMU_CAPS_DEVICE_VFIO_CCW }, }; static struct virQEMUCapsStringFlags virQEMUCapsObjectPropsVirtioBalloon[] = { @@ -1244,6 +1249,10 @@ static struct virQEMUCapsStringFlags virQEMUCapsObjectPropsIntelIOMMU[] = { { "device-iotlb", QEMU_CAPS_INTEL_IOMMU_DEVICE_IOTLB }, }; +static struct virQEMUCapsStringFlags virQEMUCapsObjectPropsVirtualCSSBridge[] = { + { "cssid-unrestricted", QEMU_CAPS_CCW_CSSID_UNRESTRICTED }, +}; + /* see documentation for virQEMUQAPISchemaPathGet for the query format */ static struct virQEMUCapsStringFlags virQEMUCapsQMPSchemaQueries[] = { { "blockdev-add/arg-type/options/+gluster/debug-level", QEMU_CAPS_GLUSTER_DEBUG_LEVEL}, @@ -1363,6 +1372,9 @@ static struct virQEMUCapsObjectTypeProps virQEMUCapsObjectProps[] = { { "virtio-gpu-ccw", virQEMUCapsObjectPropsVirtioGpu, ARRAY_CARDINALITY(virQEMUCapsObjectPropsVirtioGpu), QEMU_CAPS_DEVICE_VIRTIO_GPU_CCW }, + { "virtual-css-bridge", virQEMUCapsObjectPropsVirtualCSSBridge, + ARRAY_CARDINALITY(virQEMUCapsObjectPropsVirtualCSSBridge), + QEMU_CAPS_CCW }, }; @@ -3933,6 +3945,8 @@ virQEMUCapsInitQMPMonitor(virQEMUCapsPtr qemuCaps, if (!virQEMUCapsGet(qemuCaps, QEMU_CAPS_CCW) && virQEMUCapsGet(qemuCaps, QEMU_CAPS_VIRTIO_CCW)) virQEMUCapsSet(qemuCaps, QEMU_CAPS_CCW); + if (!virQEMUCapsGet(qemuCaps, QEMU_CAPS_CCW_CSSID_UNRESTRICTED)) + virQEMUCapsClear(qemuCaps, QEMU_CAPS_DEVICE_VFIO_CCW); } ret = 0; diff --git a/src/qemu/qemu_capabilities.h b/src/qemu/qemu_capabilities.h index 728d7fa7d2..c489aeb9c3 100644 --- a/src/qemu/qemu_capabilities.h +++ b/src/qemu/qemu_capabilities.h @@ -453,6 +453,10 @@ typedef enum { QEMU_CAPS_QCOW2_LUKS, /* qcow2 format support LUKS encryption */ QEMU_CAPS_DEVICE_PCIE_PCI_BRIDGE, /* -device pcie-pci-bridge */ QEMU_CAPS_CCW, /* -device virtual-css-bridge */ + QEMU_CAPS_CCW_CSSID_UNRESTRICTED, /* virtual-css-bridge.cssid-unrestricted= */ + + /* 290 */ + QEMU_CAPS_DEVICE_VFIO_CCW, /* -device vfio-ccw */ QEMU_CAPS_LAST /* this must always be the last item */ } virQEMUCapsFlags; diff --git a/tests/qemucapabilitiesdata/caps_2.10.0.s390x.replies b/tests/qemucapabilitiesdata/caps_2.10.0.s390x.replies index 534756f0b3..3e19ac67da 100644 --- a/tests/qemucapabilitiesdata/caps_2.10.0.s390x.replies +++ b/tests/qemucapabilitiesdata/caps_2.10.0.s390x.replies @@ -3405,6 +3405,16 @@ { "return": [ { + "name": "css_dev_path", + "type": "bool" + } + ], + "id": "libvirt-34" +} + +{ + "return": [ + { "hotpluggable-cpus": false, "name": "s390-ccw-virtio-2.7", "cpu-max": 248 @@ -3447,7 +3457,7 @@ "cpu-max": 248 } ], - "id": "libvirt-34" + "id": "libvirt-35" } { @@ -3981,19 +3991,19 @@ "migration-safe": true } ], - "id": "libvirt-35" + "id": "libvirt-36" } { "return": [ ], - "id": "libvirt-36" + "id": "libvirt-37" } { "return": [ ], - "id": "libvirt-37" + "id": "libvirt-38" } { @@ -5098,7 +5108,7 @@ "option": "drive" } ], - "id": "libvirt-38" + "id": "libvirt-39" } { @@ -5148,7 +5158,7 @@ "capability": "return-path" } ], - "id": "libvirt-39" + "id": "libvirt-40" } { @@ -14871,7 +14881,7 @@ "meta-type": "object" } ], - "id": "libvirt-40" + "id": "libvirt-41" } { @@ -14911,11 +14921,11 @@ } } }, - "id": "libvirt-41" + "id": "libvirt-42" } { - "id": "libvirt-42", + "id": "libvirt-43", "error": { "class": "GenericError", "desc": "Property '.migratable' not found" diff --git a/tests/qemucapabilitiesdata/caps_2.10.0.s390x.xml b/tests/qemucapabilitiesdata/caps_2.10.0.s390x.xml index c8bd2c2b74..ae54e29d80 100644 --- a/tests/qemucapabilitiesdata/caps_2.10.0.s390x.xml +++ b/tests/qemucapabilitiesdata/caps_2.10.0.s390x.xml @@ -150,7 +150,7 @@ <flag name='virtual-css-bridge'/> <version>2010000</version> <kvmVersion>0</kvmVersion> - <microcodeVersion>303326</microcodeVersion> + <microcodeVersion>303434</microcodeVersion> <package></package> <arch>s390x</arch> <hostCPU type='kvm' model='z14-base' migratability='no'> diff --git a/tests/qemucapabilitiesdata/caps_2.11.0.s390x.replies b/tests/qemucapabilitiesdata/caps_2.11.0.s390x.replies index 2de256009e..21fede318b 100644 --- a/tests/qemucapabilitiesdata/caps_2.11.0.s390x.replies +++ b/tests/qemucapabilitiesdata/caps_2.11.0.s390x.replies @@ -3524,6 +3524,16 @@ { "return": [ { + "name": "css_dev_path", + "type": "bool" + } + ], + "id": "libvirt-35" +} + +{ + "return": [ + { "hotpluggable-cpus": true, "name": "s390-ccw-virtio-2.7", "cpu-max": 248 @@ -3571,7 +3581,7 @@ "cpu-max": 248 } ], - "id": "libvirt-35" + "id": "libvirt-36" } { @@ -4105,20 +4115,20 @@ "migration-safe": true } ], - "id": "libvirt-36" + "id": "libvirt-37" } { "return": [ ], - "id": "libvirt-37" + "id": "libvirt-38" } { "return": [ "emulator" ], - "id": "libvirt-38" + "id": "libvirt-39" } { @@ -5239,7 +5249,7 @@ "option": "drive" } ], - "id": "libvirt-39" + "id": "libvirt-40" } { @@ -5297,7 +5307,7 @@ "capability": "x-multifd" } ], - "id": "libvirt-40" + "id": "libvirt-41" } { @@ -15165,7 +15175,7 @@ "meta-type": "object" } ], - "id": "libvirt-41" + "id": "libvirt-42" } { @@ -15204,11 +15214,11 @@ } } }, - "id": "libvirt-42" + "id": "libvirt-43" } { - "id": "libvirt-43", + "id": "libvirt-44", "error": { "class": "GenericError", "desc": "Property '.migratable' not found" diff --git a/tests/qemucapabilitiesdata/caps_2.11.0.s390x.xml b/tests/qemucapabilitiesdata/caps_2.11.0.s390x.xml index de886267bd..c162f74f6d 100644 --- a/tests/qemucapabilitiesdata/caps_2.11.0.s390x.xml +++ b/tests/qemucapabilitiesdata/caps_2.11.0.s390x.xml @@ -154,7 +154,7 @@ <flag name='virtual-css-bridge'/> <version>2011000</version> <kvmVersion>0</kvmVersion> - <microcodeVersion>342058</microcodeVersion> + <microcodeVersion>342166</microcodeVersion> <package></package> <arch>s390x</arch> <hostCPU type='kvm' model='z14-base' migratability='no'> diff --git a/tests/qemucapabilitiesdata/caps_2.12.0.s390x.replies b/tests/qemucapabilitiesdata/caps_2.12.0.s390x.replies index c4e44c6d0f..4a0317b3cb 100644 --- a/tests/qemucapabilitiesdata/caps_2.12.0.s390x.replies +++ b/tests/qemucapabilitiesdata/caps_2.12.0.s390x.replies @@ -3617,6 +3617,21 @@ { "return": [ { + "name": "cssid-unrestricted", + "description": "A css device can use any cssid, regardless whether virtual or not (read only, always true)", + "type": "bool" + }, + { + "name": "css_dev_path", + "type": "bool" + } + ], + "id": "libvirt-35" +} + +{ + "return": [ + { "hotpluggable-cpus": true, "name": "s390-ccw-virtio-2.7", "cpu-max": 248 @@ -3669,7 +3684,7 @@ "alias": "s390-ccw-virtio" } ], - "id": "libvirt-35" + "id": "libvirt-36" } { @@ -6324,20 +6339,20 @@ "migration-safe": true } ], - "id": "libvirt-36" + "id": "libvirt-37" } { "return": [ ], - "id": "libvirt-37" + "id": "libvirt-38" } { "return": [ "emulator" ], - "id": "libvirt-38" + "id": "libvirt-39" } { @@ -7493,7 +7508,7 @@ "option": "drive" } ], - "id": "libvirt-39" + "id": "libvirt-40" } { @@ -7555,7 +7570,7 @@ "capability": "dirty-bitmaps" } ], - "id": "libvirt-40" + "id": "libvirt-41" } { @@ -18923,11 +18938,11 @@ "meta-type": "object" } ], - "id": "libvirt-41" + "id": "libvirt-42" } { - "id": "libvirt-42", + "id": "libvirt-43", "error": { "class": "GenericError", "desc": "The CPU definition 'max' is unknown." diff --git a/tests/qemucapabilitiesdata/caps_2.12.0.s390x.xml b/tests/qemucapabilitiesdata/caps_2.12.0.s390x.xml index 191b1e0e37..728f92dcfc 100644 --- a/tests/qemucapabilitiesdata/caps_2.12.0.s390x.xml +++ b/tests/qemucapabilitiesdata/caps_2.12.0.s390x.xml @@ -151,6 +151,9 @@ <flag name='virtio-mouse-ccw'/> <flag name='virtio-tablet-ccw'/> <flag name='qcow2-luks'/> + <flag name='virtual-css-bridge'/> + <flag name='virtual-css-bridge.cssid-unrestricted'/> + <flag name='vfio-ccw'/> <version>2011090</version> <kvmVersion>0</kvmVersion> <microcodeVersion>0</microcodeVersion> diff --git a/tests/qemucapabilitiesdata/caps_2.7.0.s390x.replies b/tests/qemucapabilitiesdata/caps_2.7.0.s390x.replies index 61fbd9a667..fe2aecd2b6 100644 --- a/tests/qemucapabilitiesdata/caps_2.7.0.s390x.replies +++ b/tests/qemucapabilitiesdata/caps_2.7.0.s390x.replies @@ -2550,6 +2550,16 @@ { "return": [ { + "name": "css_dev_path", + "type": "bool" + } + ], + "id": "libvirt-34" +} + +{ + "return": [ + { "hotpluggable-cpus": false, "name": "s390-ccw-virtio-2.5", "cpu-max": 248 @@ -2577,7 +2587,7 @@ "cpu-max": 248 } ], - "id": "libvirt-34" + "id": "libvirt-35" } { @@ -2586,19 +2596,19 @@ "name": "host" } ], - "id": "libvirt-35" + "id": "libvirt-36" } { "return": [ ], - "id": "libvirt-36" + "id": "libvirt-37" } { "return": [ ], - "id": "libvirt-37" + "id": "libvirt-38" } { @@ -3534,7 +3544,7 @@ "option": "drive" } ], - "id": "libvirt-38" + "id": "libvirt-39" } { @@ -3568,7 +3578,7 @@ "capability": "postcopy-ram" } ], - "id": "libvirt-39" + "id": "libvirt-40" } { @@ -11924,7 +11934,7 @@ "meta-type": "object" } ], - "id": "libvirt-40" + "id": "libvirt-41" } { diff --git a/tests/qemucapabilitiesdata/caps_2.7.0.s390x.xml b/tests/qemucapabilitiesdata/caps_2.7.0.s390x.xml index 0d2c7f353b..533b8020c4 100644 --- a/tests/qemucapabilitiesdata/caps_2.7.0.s390x.xml +++ b/tests/qemucapabilitiesdata/caps_2.7.0.s390x.xml @@ -140,7 +140,7 @@ <flag name='virtual-css-bridge'/> <version>2007000</version> <kvmVersion>0</kvmVersion> - <microcodeVersion>216732</microcodeVersion> + <microcodeVersion>216840</microcodeVersion> <package></package> <arch>s390x</arch> <cpu type='kvm' name='host'/> diff --git a/tests/qemucapabilitiesdata/caps_2.8.0.s390x.replies b/tests/qemucapabilitiesdata/caps_2.8.0.s390x.replies index 818118caf2..34734ec19b 100644 --- a/tests/qemucapabilitiesdata/caps_2.8.0.s390x.replies +++ b/tests/qemucapabilitiesdata/caps_2.8.0.s390x.replies @@ -2823,6 +2823,16 @@ { "return": [ { + "name": "css_dev_path", + "type": "bool" + } + ], + "id": "libvirt-34" +} + +{ + "return": [ + { "hotpluggable-cpus": false, "name": "s390-ccw-virtio-2.7", "cpu-max": 248 @@ -2855,7 +2865,7 @@ "alias": "s390-ccw-virtio" } ], - "id": "libvirt-34" + "id": "libvirt-35" } { @@ -3181,19 +3191,19 @@ "migration-safe": true } ], - "id": "libvirt-35" + "id": "libvirt-36" } { "return": [ ], - "id": "libvirt-36" + "id": "libvirt-37" } { "return": [ ], - "id": "libvirt-37" + "id": "libvirt-38" } { @@ -4154,7 +4164,7 @@ "option": "drive" } ], - "id": "libvirt-38" + "id": "libvirt-39" } { @@ -4192,7 +4202,7 @@ "capability": "x-colo" } ], - "id": "libvirt-39" + "id": "libvirt-40" } { @@ -12962,7 +12972,7 @@ "meta-type": "object" } ], - "id": "libvirt-40" + "id": "libvirt-41" } { @@ -12988,11 +12998,11 @@ } } }, - "id": "libvirt-41" + "id": "libvirt-42" } { - "id": "libvirt-42", + "id": "libvirt-43", "error": { "class": "GenericError", "desc": "Property '.migratable' not found" diff --git a/tests/qemucapabilitiesdata/caps_2.8.0.s390x.xml b/tests/qemucapabilitiesdata/caps_2.8.0.s390x.xml index 9c7a028584..8e142a343b 100644 --- a/tests/qemucapabilitiesdata/caps_2.8.0.s390x.xml +++ b/tests/qemucapabilitiesdata/caps_2.8.0.s390x.xml @@ -142,7 +142,7 @@ <flag name='virtual-css-bridge'/> <version>2007093</version> <kvmVersion>0</kvmVersion> - <microcodeVersion>241633</microcodeVersion> + <microcodeVersion>241741</microcodeVersion> <package></package> <arch>s390x</arch> <hostCPU type='kvm' model='zEC12.2-base' migratability='no'> diff --git a/tests/qemucapabilitiesdata/caps_2.9.0.s390x.replies b/tests/qemucapabilitiesdata/caps_2.9.0.s390x.replies index cbacec6d02..967148a022 100644 --- a/tests/qemucapabilitiesdata/caps_2.9.0.s390x.replies +++ b/tests/qemucapabilitiesdata/caps_2.9.0.s390x.replies @@ -3104,6 +3104,16 @@ { "return": [ { + "name": "css_dev_path", + "type": "bool" + } + ], + "id": "libvirt-34" +} + +{ + "return": [ + { "hotpluggable-cpus": false, "name": "s390-ccw-virtio-2.7", "cpu-max": 248 @@ -3141,7 +3151,7 @@ "cpu-max": 248 } ], - "id": "libvirt-34" + "id": "libvirt-35" } { @@ -3531,19 +3541,19 @@ "migration-safe": true } ], - "id": "libvirt-35" + "id": "libvirt-36" } { "return": [ ], - "id": "libvirt-36" + "id": "libvirt-37" } { "return": [ ], - "id": "libvirt-37" + "id": "libvirt-38" } { @@ -4618,7 +4628,7 @@ "option": "drive" } ], - "id": "libvirt-38" + "id": "libvirt-39" } { @@ -4660,7 +4670,7 @@ "capability": "release-ram" } ], - "id": "libvirt-39" + "id": "libvirt-40" } { @@ -13946,7 +13956,7 @@ "meta-type": "object" } ], - "id": "libvirt-40" + "id": "libvirt-41" } { @@ -13973,11 +13983,11 @@ } } }, - "id": "libvirt-41" + "id": "libvirt-42" } { - "id": "libvirt-42", + "id": "libvirt-43", "error": { "class": "GenericError", "desc": "Property '.migratable' not found" diff --git a/tests/qemucapabilitiesdata/caps_2.9.0.s390x.xml b/tests/qemucapabilitiesdata/caps_2.9.0.s390x.xml index 5b4dc0e8ba..431e4d8324 100644 --- a/tests/qemucapabilitiesdata/caps_2.9.0.s390x.xml +++ b/tests/qemucapabilitiesdata/caps_2.9.0.s390x.xml @@ -145,7 +145,7 @@ <flag name='virtual-css-bridge'/> <version>2009000</version> <kvmVersion>0</kvmVersion> - <microcodeVersion>265051</microcodeVersion> + <microcodeVersion>265159</microcodeVersion> <package></package> <arch>s390x</arch> <hostCPU type='kvm' model='z13.2-base' migratability='no'> -- 2.13.4 -- libvir-list mailing list libvir-list@xxxxxxxxxx https://www.redhat.com/mailman/listinfo/libvir-list