qemu: introduce vfio-ccw capability

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@linux.vnet.ibm.com>
Reviewed-by: Bjoern Walk <bwalk@linux.ibm.com>
Reviewed-by: Boris Fiuczynski <fiuczy@linux.ibm.com>
Reviewed-by: John Ferlan <jferlan@redhat.com>
This commit is contained in:
Shalini Chellathurai Saroja 2018-05-07 16:41:12 +02:00 committed by John Ferlan
parent f245a9791c
commit 263e65fd20
14 changed files with 150 additions and 69 deletions

View File

@ -481,6 +481,8 @@ VIR_ENUM_IMPL(virQEMUCaps, QEMU_CAPS_LAST,
"qom-list-properties",
"memory-backend-file.discard-data",
"virtual-css-bridge",
"virtual-css-bridge.cssid-unrestricted",
"vfio-ccw",
);
@ -1110,6 +1112,7 @@ struct virQEMUCapsStringFlags virQEMUCapsObjectTypes[] = {
{ "pcie-pci-bridge", QEMU_CAPS_DEVICE_PCIE_PCI_BRIDGE },
{ "pr-manager-helper", QEMU_CAPS_PR_MANAGER_HELPER },
{ "virtual-css-bridge", QEMU_CAPS_CCW },
{ "vfio-ccw", QEMU_CAPS_DEVICE_VFIO_CCW },
};
static struct virQEMUCapsStringFlags virQEMUCapsDevicePropsVirtioBalloon[] = {
@ -1251,6 +1254,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},
@ -1376,6 +1383,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 },
};
static struct virQEMUCapsStringFlags virQEMUCapsObjectPropsMemoryBackendFile[] = {
@ -3937,6 +3947,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;

View File

@ -465,6 +465,8 @@ typedef enum { /* virQEMUCapsFlags grouping marker for syntax-check */
QEMU_CAPS_QOM_LIST_PROPERTIES, /* qom-list-properties monitor command */
QEMU_CAPS_OBJECT_MEMORY_FILE_DISCARD, /* -object memory-backend-file,discard-data */
QEMU_CAPS_CCW, /* -device virtual-css-bridge */
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;

View File

@ -3402,6 +3402,16 @@
"id": "libvirt-33"
}
{
"return": [
{
"name": "css_dev_path",
"type": "bool"
}
],
"id": "libvirt-34"
}
{
"return": [
{
@ -3447,7 +3457,7 @@
"cpu-max": 248
}
],
"id": "libvirt-34"
"id": "libvirt-35"
}
{
@ -3981,12 +3991,6 @@
"migration-safe": true
}
],
"id": "libvirt-35"
}
{
"return": [
],
"id": "libvirt-36"
}
@ -3996,6 +4000,12 @@
"id": "libvirt-37"
}
{
"return": [
],
"id": "libvirt-38"
}
{
"return": [
{
@ -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"

View File

@ -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'>

View File

@ -3521,6 +3521,16 @@
"id": "libvirt-34"
}
{
"return": [
{
"name": "css_dev_path",
"type": "bool"
}
],
"id": "libvirt-35"
}
{
"return": [
{
@ -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"

View File

@ -123,7 +123,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'>

View File

@ -3614,6 +3614,21 @@
"id": "libvirt-34"
}
{
"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": [
{
@ -3665,7 +3680,7 @@
"type": "string"
}
],
"id": "libvirt-35"
"id": "libvirt-36"
}
{
@ -3723,7 +3738,7 @@
"alias": "s390-ccw-virtio"
}
],
"id": "libvirt-36"
"id": "libvirt-37"
}
{
@ -6378,20 +6393,20 @@
"migration-safe": true
}
],
"id": "libvirt-37"
"id": "libvirt-38"
}
{
"return": [
],
"id": "libvirt-38"
"id": "libvirt-39"
}
{
"return": [
"emulator"
],
"id": "libvirt-39"
"id": "libvirt-40"
}
{
@ -7547,7 +7562,7 @@
"option": "drive"
}
],
"id": "libvirt-40"
"id": "libvirt-41"
}
{
@ -7609,7 +7624,7 @@
"capability": "dirty-bitmaps"
}
],
"id": "libvirt-41"
"id": "libvirt-42"
}
{
@ -18977,11 +18992,11 @@
"meta-type": "object"
}
],
"id": "libvirt-42"
"id": "libvirt-43"
}
{
"id": "libvirt-43",
"id": "libvirt-44",
"error": {
"class": "GenericError",
"desc": "The CPU definition 'max' is unknown."

View File

@ -124,6 +124,8 @@
<flag name='qom-list-properties'/>
<flag name='memory-backend-file.discard-data'/>
<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>

View File

@ -2547,6 +2547,16 @@
"id": "libvirt-33"
}
{
"return": [
{
"name": "css_dev_path",
"type": "bool"
}
],
"id": "libvirt-34"
}
{
"return": [
{
@ -2577,7 +2587,7 @@
"cpu-max": 248
}
],
"id": "libvirt-34"
"id": "libvirt-35"
}
{
@ -2586,12 +2596,6 @@
"name": "host"
}
],
"id": "libvirt-35"
}
{
"return": [
],
"id": "libvirt-36"
}
@ -2601,6 +2605,12 @@
"id": "libvirt-37"
}
{
"return": [
],
"id": "libvirt-38"
}
{
"return": [
{
@ -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"
}
{

View File

@ -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'/>

View File

@ -2820,6 +2820,16 @@
"id": "libvirt-33"
}
{
"return": [
{
"name": "css_dev_path",
"type": "bool"
}
],
"id": "libvirt-34"
}
{
"return": [
{
@ -2855,7 +2865,7 @@
"alias": "s390-ccw-virtio"
}
],
"id": "libvirt-34"
"id": "libvirt-35"
}
{
@ -3181,12 +3191,6 @@
"migration-safe": true
}
],
"id": "libvirt-35"
}
{
"return": [
],
"id": "libvirt-36"
}
@ -3196,6 +3200,12 @@
"id": "libvirt-37"
}
{
"return": [
],
"id": "libvirt-38"
}
{
"return": [
{
@ -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"

View File

@ -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'>

View File

@ -3101,6 +3101,16 @@
"id": "libvirt-33"
}
{
"return": [
{
"name": "css_dev_path",
"type": "bool"
}
],
"id": "libvirt-34"
}
{
"return": [
{
@ -3141,7 +3151,7 @@
"cpu-max": 248
}
],
"id": "libvirt-34"
"id": "libvirt-35"
}
{
@ -3531,12 +3541,6 @@
"migration-safe": true
}
],
"id": "libvirt-35"
}
{
"return": [
],
"id": "libvirt-36"
}
@ -3546,6 +3550,12 @@
"id": "libvirt-37"
}
{
"return": [
],
"id": "libvirt-38"
}
{
"return": [
{
@ -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"

View File

@ -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'>