From: Shalini Chellathurai Saroja <shalini@xxxxxxxxxxxxxxxxxx> 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 to make sure the devices are visible to non-mcss-e enabled guests. Signed-off-by: Shalini Chellathurai Saroja <shalini@xxxxxxxxxxxxxxxxxx> Reviewed-by: Bjoern Walk <bwalk@xxxxxxxxxxxxx> Reviewed-by: Boris Fiuczynski <fiuczy@xxxxxxxxxxxxx> --- 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 ae3d2a6..b2e1fab 100644 --- a/src/qemu/qemu_capabilities.c +++ b/src/qemu/qemu_capabilities.c @@ -476,6 +476,10 @@ VIR_ENUM_IMPL(virQEMUCaps, QEMU_CAPS_LAST, "nbd-tls", "tpm-crb", "virtual-css-bridge", + + /* 295 */ + "virtual-css-bridge.cssid-unrestricted", + "vfio-ccw", ); @@ -1103,6 +1107,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 virQEMUCapsDevicePropsVirtioBalloon[] = { @@ -1244,6 +1249,10 @@ static struct virQEMUCapsStringFlags virQEMUCapsDevicePropsIntelIOMMU[] = { { "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}, @@ -1369,6 +1378,9 @@ static virQEMUCapsObjectTypeProps virQEMUCapsDeviceProps[] = { { "virtio-gpu-ccw", virQEMUCapsDevicePropsVirtioGpu, ARRAY_CARDINALITY(virQEMUCapsDevicePropsVirtioGpu), QEMU_CAPS_DEVICE_VIRTIO_GPU_CCW }, + { "virtual-css-bridge", virQEMUCapsObjectPropsVirtualCSSBridge, + ARRAY_CARDINALITY(virQEMUCapsObjectPropsVirtualCSSBridge), + QEMU_CAPS_CCW }, }; @@ -3913,6 +3925,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 e8a916c..74ac41d 100644 --- a/src/qemu/qemu_capabilities.h +++ b/src/qemu/qemu_capabilities.h @@ -461,6 +461,10 @@ typedef enum { /* virQEMUCapsFlags grouping marker for syntax-check */ QEMU_CAPS_DEVICE_TPM_CRB, /* -device tpm-crb */ QEMU_CAPS_CCW, /* -device virtual-css-bridge */ + /* 295 */ + QEMU_CAPS_CCW_CSSID_UNRESTRICTED, /* virtual-css-bridge.cssid-unrestricted= */ + 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 534756f..3e19ac6 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 24bd8e8..cb7b35c 100644 --- a/tests/qemucapabilitiesdata/caps_2.10.0.s390x.xml +++ b/tests/qemucapabilitiesdata/caps_2.10.0.s390x.xml @@ -117,7 +117,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 2de2560..21fede3 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 6776031..cefb863 100644 --- a/tests/qemucapabilitiesdata/caps_2.11.0.s390x.xml +++ b/tests/qemucapabilitiesdata/caps_2.11.0.s390x.xml @@ -122,7 +122,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 c4e44c6..4a0317b 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 80f3ec6..f1995eb 100644 --- a/tests/qemucapabilitiesdata/caps_2.12.0.s390x.xml +++ b/tests/qemucapabilitiesdata/caps_2.12.0.s390x.xml @@ -120,6 +120,9 @@ <flag name='query-cpus-fast'/> <flag name='disk-write-cache'/> <flag name='nbd-tls'/> + <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 61fbd9a..fe2aecd 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 10ce426..3c5601c 100644 --- a/tests/qemucapabilitiesdata/caps_2.7.0.s390x.xml +++ b/tests/qemucapabilitiesdata/caps_2.7.0.s390x.xml @@ -107,7 +107,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 818118c..34734ec 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 800fcc5..55c2c5b 100644 --- a/tests/qemucapabilitiesdata/caps_2.8.0.s390x.xml +++ b/tests/qemucapabilitiesdata/caps_2.8.0.s390x.xml @@ -109,7 +109,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 cbacec6..967148a 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 f8aee83..497e02d 100644 --- a/tests/qemucapabilitiesdata/caps_2.9.0.s390x.xml +++ b/tests/qemucapabilitiesdata/caps_2.9.0.s390x.xml @@ -112,7 +112,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.9.4 -- libvir-list mailing list libvir-list@xxxxxxxxxx https://www.redhat.com/mailman/listinfo/libvir-list