提交 124eb803 编写于 作者: A Andrea Bolognani

qemu: Introduce QEMU_CAPS_MACHINE_VIRT_IOMMU

This capability can be used to figure out whether the
QEMU binary at hand supports the machine type property
we need in order to enable SMMUv3 IOMMU support.

Unfortunately we can't avoid probing the RISC-V binaries
along with the ARM ones, since both architectures have
their own 'virt' machine type.
Signed-off-by: NAndrea Bolognani <abologna@redhat.com>
Reviewed-by: NJán Tomko <jtomko@redhat.com>
上级 21bb887a
......@@ -525,6 +525,7 @@ VIR_ENUM_IMPL(virQEMUCaps,
"virtio-pci-non-transitional",
"overcommit",
"query-current-machine",
"machine.virt.iommu",
);
......@@ -1406,10 +1407,17 @@ static struct virQEMUCapsStringFlags virQEMUCapsMachinePropsPSeries[] = {
{ "cap-nested-hv", QEMU_CAPS_MACHINE_PSERIES_CAP_NESTED_HV },
};
static struct virQEMUCapsStringFlags virQEMUCapsMachinePropsVirt[] = {
{ "iommu", QEMU_CAPS_MACHINE_VIRT_IOMMU },
};
static virQEMUCapsObjectTypeProps virQEMUCapsMachineProps[] = {
{ "pseries", virQEMUCapsMachinePropsPSeries,
ARRAY_CARDINALITY(virQEMUCapsMachinePropsPSeries),
-1 },
{ "virt", virQEMUCapsMachinePropsVirt,
ARRAY_CARDINALITY(virQEMUCapsMachinePropsVirt),
-1 },
};
static void
......
......@@ -507,6 +507,7 @@ typedef enum { /* virQEMUCapsFlags grouping marker for syntax-check */
QEMU_CAPS_VIRTIO_PCI_TRANSITIONAL, /* virtio *-pci-{non-}transitional devices */
QEMU_CAPS_OVERCOMMIT, /* -overcommit */
QEMU_CAPS_QUERY_CURRENT_MACHINE, /* query-current-machine command */
QEMU_CAPS_MACHINE_VIRT_IOMMU, /* -machine virt,iommu */
QEMU_CAPS_LAST /* this must always be the last item */
} virQEMUCapsFlags;
......
......@@ -5633,10 +5633,148 @@
}
{
"execute": "query-cpu-definitions",
"execute": "qom-list-properties",
"arguments": {
"typename": "virt-2.12-machine"
},
"id": "libvirt-32"
}
{
"return": [
{
"name": "graphics",
"description": "Set on/off to enable/disable graphics emulation",
"type": "bool"
},
{
"name": "phandle-start",
"description": "The first phandle ID we may generate dynamically",
"type": "int"
},
{
"name": "dump-guest-core",
"description": "Include guest memory in a core dump",
"type": "bool"
},
{
"name": "kernel-irqchip",
"description": "Configure KVM in-kernel irqchip",
"type": "on|off|split"
},
{
"name": "accel",
"description": "Accelerator list",
"type": "string"
},
{
"name": "append",
"description": "Linux kernel command line",
"type": "string"
},
{
"name": "dumpdtb",
"description": "Dump current dtb to a file and quit",
"type": "string"
},
{
"name": "memory-encryption",
"description": "Set memory encyption object to use",
"type": "string"
},
{
"name": "igd-passthru",
"description": "Set on/off to enable/disable igd passthrou",
"type": "bool"
},
{
"name": "dt-compatible",
"description": "Overrides the \"compatible\" property of the dt root node",
"type": "string"
},
{
"name": "kernel",
"description": "Linux kernel image file",
"type": "string"
},
{
"name": "usb",
"description": "Set on/off to enable/disable usb",
"type": "bool"
},
{
"name": "suppress-vmdesc",
"description": "Set on to disable self-describing migration",
"type": "bool"
},
{
"name": "dtb",
"description": "Linux kernel device tree file",
"type": "string"
},
{
"name": "firmware",
"description": "Firmware image",
"type": "string"
},
{
"name": "mem-merge",
"description": "Enable/disable memory merge support",
"type": "bool"
},
{
"name": "initrd",
"description": "Linux initial ramdisk file",
"type": "string"
},
{
"name": "enforce-config-section",
"description": "Set on to enforce configuration section migration",
"type": "bool"
},
{
"name": "kvm-shadow-mem",
"description": "KVM shadow MMU size",
"type": "int"
},
{
"name": "virtualization",
"description": "Set on/off to enable/disable emulating a guest CPU which implements the ARM Virtualization Extensions",
"type": "bool"
},
{
"name": "type",
"type": "string"
},
{
"name": "its",
"description": "Set on/off to enable/disable ITS instantiation",
"type": "bool"
},
{
"name": "gic-version",
"description": "Set GIC version. Valid values are 2, 3 and host",
"type": "string"
},
{
"name": "highmem",
"description": "Set on/off to enable/disable using physical address space above 32 bits",
"type": "bool"
},
{
"name": "secure",
"description": "Set on/off to enable/disable the ARM Security Extensions (TrustZone)",
"type": "bool"
}
],
"id": "libvirt-32"
}
{
"execute": "query-cpu-definitions",
"id": "libvirt-33"
}
{
"return": [
{
......@@ -5810,35 +5948,35 @@
"static": false
}
],
"id": "libvirt-32"
"id": "libvirt-33"
}
{
"execute": "query-tpm-models",
"id": "libvirt-33"
"id": "libvirt-34"
}
{
"return": [
],
"id": "libvirt-33"
"id": "libvirt-34"
}
{
"execute": "query-tpm-types",
"id": "libvirt-34"
"id": "libvirt-35"
}
{
"return": [
"emulator"
],
"id": "libvirt-34"
"id": "libvirt-35"
}
{
"execute": "query-command-line-options",
"id": "libvirt-35"
"id": "libvirt-36"
}
{
......@@ -6999,12 +7137,12 @@
"option": "drive"
}
],
"id": "libvirt-35"
"id": "libvirt-36"
}
{
"execute": "query-migrate-capabilities",
"id": "libvirt-36"
"id": "libvirt-37"
}
{
......@@ -7066,12 +7204,12 @@
"capability": "dirty-bitmaps"
}
],
"id": "libvirt-36"
"id": "libvirt-37"
}
{
"execute": "query-qmp-schema",
"id": "libvirt-37"
"id": "libvirt-38"
}
{
......@@ -18439,12 +18577,12 @@
"meta-type": "object"
}
],
"id": "libvirt-37"
"id": "libvirt-38"
}
{
"execute": "query-gic-capabilities",
"id": "libvirt-38"
"id": "libvirt-39"
}
{
......@@ -18460,7 +18598,7 @@
"kernel": false
}
],
"id": "libvirt-38"
"id": "libvirt-39"
}
{
......
......@@ -1698,32 +1698,145 @@
}
{
"execute": "query-tpm-models",
"execute": "qom-list-properties",
"arguments": {
"typename": "virt-machine"
},
"id": "libvirt-28"
}
{
"return": [
{
"name": "enforce-config-section",
"description": "Set on to enforce configuration section migration",
"type": "bool"
},
{
"name": "kernel",
"description": "Linux kernel image file",
"type": "string"
},
{
"name": "dt-compatible",
"description": "Overrides the \"compatible\" property of the dt root node",
"type": "string"
},
{
"name": "initrd",
"description": "Linux initial ramdisk file",
"type": "string"
},
{
"name": "graphics",
"description": "Set on/off to enable/disable graphics emulation",
"type": "bool"
},
{
"name": "kernel-irqchip",
"description": "Configure KVM in-kernel irqchip",
"type": "on|off|split"
},
{
"name": "usb",
"description": "Set on/off to enable/disable usb",
"type": "bool"
},
{
"name": "firmware",
"description": "Firmware image",
"type": "string"
},
{
"name": "memory-encryption",
"description": "Set memory encyption object to use",
"type": "string"
},
{
"name": "dump-guest-core",
"description": "Include guest memory in a core dump",
"type": "bool"
},
{
"name": "kvm-shadow-mem",
"description": "KVM shadow MMU size",
"type": "int"
},
{
"name": "igd-passthru",
"description": "Set on/off to enable/disable igd passthrou",
"type": "bool"
},
{
"name": "phandle-start",
"description": "The first phandle ID we may generate dynamically",
"type": "int"
},
{
"name": "dumpdtb",
"description": "Dump current dtb to a file and quit",
"type": "string"
},
{
"name": "mem-merge",
"description": "Enable/disable memory merge support",
"type": "bool"
},
{
"name": "dtb",
"description": "Linux kernel device tree file",
"type": "string"
},
{
"name": "accel",
"description": "Accelerator list",
"type": "string"
},
{
"name": "append",
"description": "Linux kernel command line",
"type": "string"
},
{
"name": "suppress-vmdesc",
"description": "Set on to disable self-describing migration",
"type": "bool"
},
{
"name": "type",
"type": "string"
}
],
"id": "libvirt-28"
}
{
"execute": "query-tpm-types",
"execute": "query-tpm-models",
"id": "libvirt-29"
}
{
"return": [
],
"id": "libvirt-29"
}
{
"execute": "query-tpm-types",
"id": "libvirt-30"
}
{
"return": [
"passthrough",
"emulator"
],
"id": "libvirt-29"
"id": "libvirt-30"
}
{
"execute": "query-command-line-options",
"id": "libvirt-30"
"id": "libvirt-31"
}
{
......@@ -2848,12 +2961,12 @@
"option": "drive"
}
],
"id": "libvirt-30"
"id": "libvirt-31"
}
{
"execute": "query-migrate-capabilities",
"id": "libvirt-31"
"id": "libvirt-32"
}
{
......@@ -2923,12 +3036,12 @@
"capability": "late-block-activate"
}
],
"id": "libvirt-31"
"id": "libvirt-32"
}
{
"execute": "query-qmp-schema",
"id": "libvirt-32"
"id": "libvirt-33"
}
{
......@@ -14603,5 +14716,5 @@
"meta-type": "object"
}
],
"id": "libvirt-32"
"id": "libvirt-33"
}
......@@ -1698,32 +1698,145 @@
}
{
"execute": "query-tpm-models",
"execute": "qom-list-properties",
"arguments": {
"typename": "virt-machine"
},
"id": "libvirt-28"
}
{
"return": [
{
"name": "enforce-config-section",
"description": "Set on to enforce configuration section migration",
"type": "bool"
},
{
"name": "kernel",
"description": "Linux kernel image file",
"type": "string"
},
{
"name": "dt-compatible",
"description": "Overrides the \"compatible\" property of the dt root node",
"type": "string"
},
{
"name": "initrd",
"description": "Linux initial ramdisk file",
"type": "string"
},
{
"name": "graphics",
"description": "Set on/off to enable/disable graphics emulation",
"type": "bool"
},
{
"name": "kernel-irqchip",
"description": "Configure KVM in-kernel irqchip",
"type": "on|off|split"
},
{
"name": "usb",
"description": "Set on/off to enable/disable usb",
"type": "bool"
},
{
"name": "firmware",
"description": "Firmware image",
"type": "string"
},
{
"name": "memory-encryption",
"description": "Set memory encyption object to use",
"type": "string"
},
{
"name": "dump-guest-core",
"description": "Include guest memory in a core dump",
"type": "bool"
},
{
"name": "kvm-shadow-mem",
"description": "KVM shadow MMU size",
"type": "int"
},
{
"name": "igd-passthru",
"description": "Set on/off to enable/disable igd passthrou",
"type": "bool"
},
{
"name": "phandle-start",
"description": "The first phandle ID we may generate dynamically",
"type": "int"
},
{
"name": "dumpdtb",
"description": "Dump current dtb to a file and quit",
"type": "string"
},
{
"name": "mem-merge",
"description": "Enable/disable memory merge support",
"type": "bool"
},
{
"name": "dtb",
"description": "Linux kernel device tree file",
"type": "string"
},
{
"name": "accel",
"description": "Accelerator list",
"type": "string"
},
{
"name": "append",
"description": "Linux kernel command line",
"type": "string"
},
{
"name": "suppress-vmdesc",
"description": "Set on to disable self-describing migration",
"type": "bool"
},
{
"name": "type",
"type": "string"
}
],
"id": "libvirt-28"
}
{
"execute": "query-tpm-types",
"execute": "query-tpm-models",
"id": "libvirt-29"
}
{
"return": [
],
"id": "libvirt-29"
}
{
"execute": "query-tpm-types",
"id": "libvirt-30"
}
{
"return": [
"passthrough",
"emulator"
],
"id": "libvirt-29"
"id": "libvirt-30"
}
{
"execute": "query-command-line-options",
"id": "libvirt-30"
"id": "libvirt-31"
}
{
......@@ -2848,12 +2961,12 @@
"option": "drive"
}
],
"id": "libvirt-30"
"id": "libvirt-31"
}
{
"execute": "query-migrate-capabilities",
"id": "libvirt-31"
"id": "libvirt-32"
}
{
......@@ -2923,12 +3036,12 @@
"capability": "late-block-activate"
}
],
"id": "libvirt-31"
"id": "libvirt-32"
}
{
"execute": "query-qmp-schema",
"id": "libvirt-32"
"id": "libvirt-33"
}
{
......@@ -14603,5 +14716,5 @@
"meta-type": "object"
}
],
"id": "libvirt-32"
"id": "libvirt-33"
}
......@@ -6211,10 +6211,153 @@
}
{
"execute": "query-cpu-definitions",
"execute": "qom-list-properties",
"arguments": {
"typename": "virt-4.0-machine"
},
"id": "libvirt-33"
}
{
"return": [
{
"name": "type",
"type": "string"
},
{
"name": "graphics",
"description": "Set on/off to enable/disable graphics emulation",
"type": "bool"
},
{
"name": "phandle-start",
"description": "The first phandle ID we may generate dynamically",
"type": "int"
},
{
"name": "dump-guest-core",
"description": "Include guest memory in a core dump",
"type": "bool"
},
{
"name": "kernel-irqchip",
"description": "Configure KVM in-kernel irqchip",
"type": "on|off|split"
},
{
"name": "accel",
"description": "Accelerator list",
"type": "string"
},
{
"name": "append",
"description": "Linux kernel command line",
"type": "string"
},
{
"name": "dumpdtb",
"description": "Dump current dtb to a file and quit",
"type": "string"
},
{
"name": "memory-encryption",
"description": "Set memory encryption object to use",
"type": "string"
},
{
"name": "igd-passthru",
"description": "Set on/off to enable/disable igd passthrou",
"type": "bool"
},
{
"name": "dt-compatible",
"description": "Overrides the \"compatible\" property of the dt root node",
"type": "string"
},
{
"name": "kernel",
"description": "Linux kernel image file",
"type": "string"
},
{
"name": "usb",
"description": "Set on/off to enable/disable usb",
"type": "bool"
},
{
"name": "suppress-vmdesc",
"description": "Set on to disable self-describing migration",
"type": "bool"
},
{
"name": "dtb",
"description": "Linux kernel device tree file",
"type": "string"
},
{
"name": "firmware",
"description": "Firmware image",
"type": "string"
},
{
"name": "mem-merge",
"description": "Enable/disable memory merge support",
"type": "bool"
},
{
"name": "initrd",
"description": "Linux initial ramdisk file",
"type": "string"
},
{
"name": "enforce-config-section",
"description": "Set on to enforce configuration section migration",
"type": "bool"
},
{
"name": "kvm-shadow-mem",
"description": "KVM shadow MMU size",
"type": "int"
},
{
"name": "virtualization",
"description": "Set on/off to enable/disable emulating a guest CPU which implements the ARM Virtualization Extensions",
"type": "bool"
},
{
"name": "its",
"description": "Set on/off to enable/disable ITS instantiation",
"type": "bool"
},
{
"name": "gic-version",
"description": "Set GIC version. Valid values are 2, 3 and host",
"type": "string"
},
{
"name": "highmem",
"description": "Set on/off to enable/disable using physical address space above 32 bits",
"type": "bool"
},
{
"name": "secure",
"description": "Set on/off to enable/disable the ARM Security Extensions (TrustZone)",
"type": "bool"
},
{
"name": "iommu",
"description": "Set the IOMMU type. Valid values are none and smmuv3",
"type": "string"
}
],
"id": "libvirt-33"
}
{
"execute": "query-cpu-definitions",
"id": "libvirt-34"
}
{
"return": [
{
......@@ -6403,34 +6546,34 @@
"static": false
}
],
"id": "libvirt-33"
"id": "libvirt-34"
}
{
"execute": "query-tpm-models",
"id": "libvirt-34"
"id": "libvirt-35"
}
{
"return": [
],
"id": "libvirt-34"
"id": "libvirt-35"
}
{
"execute": "query-tpm-types",
"id": "libvirt-35"
"id": "libvirt-36"
}
{
"return": [
],
"id": "libvirt-35"
"id": "libvirt-36"
}
{
"execute": "query-command-line-options",
"id": "libvirt-36"
"id": "libvirt-37"
}
{
......@@ -7578,12 +7721,12 @@
"option": "drive"
}
],
"id": "libvirt-36"
"id": "libvirt-37"
}
{
"execute": "query-migrate-capabilities",
"id": "libvirt-37"
"id": "libvirt-38"
}
{
......@@ -7657,12 +7800,12 @@
"capability": "x-ignore-shared"
}
],
"id": "libvirt-37"
"id": "libvirt-38"
}
{
"execute": "query-qmp-schema",
"id": "libvirt-38"
"id": "libvirt-39"
}
{
......@@ -19749,12 +19892,12 @@
]
}
],
"id": "libvirt-38"
"id": "libvirt-39"
}
{
"execute": "query-gic-capabilities",
"id": "libvirt-39"
"id": "libvirt-40"
}
{
......@@ -19770,7 +19913,7 @@
"kernel": false
}
],
"id": "libvirt-39"
"id": "libvirt-40"
}
{
......
......@@ -160,6 +160,7 @@
<flag name='virtio-pci-non-transitional'/>
<flag name='overcommit'/>
<flag name='query-current-machine'/>
<flag name='machine.virt.iommu'/>
<version>4000000</version>
<kvmVersion>0</kvmVersion>
<microcodeVersion>61700758</microcodeVersion>
......
......@@ -4080,18 +4080,120 @@
}
{
"execute": "query-tpm-models",
"execute": "qom-list-properties",
"arguments": {
"typename": "virt-machine"
},
"id": "libvirt-34"
}
{
"return": [
{
"name": "type",
"type": "string"
},
{
"name": "enforce-config-section",
"description": "Set on to enforce configuration section migration",
"type": "bool"
},
{
"name": "kernel",
"description": "Linux kernel image file",
"type": "string"
},
{
"name": "dt-compatible",
"description": "Overrides the \"compatible\" property of the dt root node",
"type": "string"
},
{
"name": "initrd",
"description": "Linux initial ramdisk file",
"type": "string"
},
{
"name": "graphics",
"description": "Set on/off to enable/disable graphics emulation",
"type": "bool"
},
{
"name": "kernel-irqchip",
"description": "Configure KVM in-kernel irqchip",
"type": "on|off|split"
},
{
"name": "usb",
"description": "Set on/off to enable/disable usb",
"type": "bool"
},
{
"name": "firmware",
"description": "Firmware image",
"type": "string"
},
{
"name": "memory-encryption",
"description": "Set memory encryption object to use",
"type": "string"
},
{
"name": "dump-guest-core",
"description": "Include guest memory in a core dump",
"type": "bool"
},
{
"name": "kvm-shadow-mem",
"description": "KVM shadow MMU size",
"type": "int"
},
{
"name": "igd-passthru",
"description": "Set on/off to enable/disable igd passthrou",
"type": "bool"
},
{
"name": "phandle-start",
"description": "The first phandle ID we may generate dynamically",
"type": "int"
},
{
"name": "dumpdtb",
"description": "Dump current dtb to a file and quit",
"type": "string"
},
{
"name": "mem-merge",
"description": "Enable/disable memory merge support",
"type": "bool"
},
{
"name": "dtb",
"description": "Linux kernel device tree file",
"type": "string"
},
{
"name": "accel",
"description": "Accelerator list",
"type": "string"
},
{
"name": "append",
"description": "Linux kernel command line",
"type": "string"
},
{
"name": "suppress-vmdesc",
"description": "Set on to disable self-describing migration",
"type": "bool"
}
],
"id": "libvirt-34"
}
{
"execute": "query-tpm-types",
"execute": "query-tpm-models",
"id": "libvirt-35"
}
......@@ -4102,10 +4204,21 @@
}
{
"execute": "query-command-line-options",
"execute": "query-tpm-types",
"id": "libvirt-36"
}
{
"return": [
],
"id": "libvirt-36"
}
{
"execute": "query-command-line-options",
"id": "libvirt-37"
}
{
"return": [
{
......@@ -5375,12 +5488,12 @@
"option": "drive"
}
],
"id": "libvirt-36"
"id": "libvirt-37"
}
{
"execute": "query-migrate-capabilities",
"id": "libvirt-37"
"id": "libvirt-38"
}
{
......@@ -5454,12 +5567,12 @@
"capability": "x-ignore-shared"
}
],
"id": "libvirt-37"
"id": "libvirt-38"
}
{
"execute": "query-qmp-schema",
"id": "libvirt-38"
"id": "libvirt-39"
}
{
......@@ -17738,5 +17851,5 @@
]
}
],
"id": "libvirt-38"
"id": "libvirt-39"
}
......@@ -4080,18 +4080,120 @@
}
{
"execute": "query-tpm-models",
"execute": "qom-list-properties",
"arguments": {
"typename": "virt-machine"
},
"id": "libvirt-34"
}
{
"return": [
{
"name": "type",
"type": "string"
},
{
"name": "enforce-config-section",
"description": "Set on to enforce configuration section migration",
"type": "bool"
},
{
"name": "kernel",
"description": "Linux kernel image file",
"type": "string"
},
{
"name": "dt-compatible",
"description": "Overrides the \"compatible\" property of the dt root node",
"type": "string"
},
{
"name": "initrd",
"description": "Linux initial ramdisk file",
"type": "string"
},
{
"name": "graphics",
"description": "Set on/off to enable/disable graphics emulation",
"type": "bool"
},
{
"name": "kernel-irqchip",
"description": "Configure KVM in-kernel irqchip",
"type": "on|off|split"
},
{
"name": "usb",
"description": "Set on/off to enable/disable usb",
"type": "bool"
},
{
"name": "firmware",
"description": "Firmware image",
"type": "string"
},
{
"name": "memory-encryption",
"description": "Set memory encryption object to use",
"type": "string"
},
{
"name": "dump-guest-core",
"description": "Include guest memory in a core dump",
"type": "bool"
},
{
"name": "kvm-shadow-mem",
"description": "KVM shadow MMU size",
"type": "int"
},
{
"name": "igd-passthru",
"description": "Set on/off to enable/disable igd passthrou",
"type": "bool"
},
{
"name": "phandle-start",
"description": "The first phandle ID we may generate dynamically",
"type": "int"
},
{
"name": "dumpdtb",
"description": "Dump current dtb to a file and quit",
"type": "string"
},
{
"name": "mem-merge",
"description": "Enable/disable memory merge support",
"type": "bool"
},
{
"name": "dtb",
"description": "Linux kernel device tree file",
"type": "string"
},
{
"name": "accel",
"description": "Accelerator list",
"type": "string"
},
{
"name": "append",
"description": "Linux kernel command line",
"type": "string"
},
{
"name": "suppress-vmdesc",
"description": "Set on to disable self-describing migration",
"type": "bool"
}
],
"id": "libvirt-34"
}
{
"execute": "query-tpm-types",
"execute": "query-tpm-models",
"id": "libvirt-35"
}
......@@ -4102,10 +4204,21 @@
}
{
"execute": "query-command-line-options",
"execute": "query-tpm-types",
"id": "libvirt-36"
}
{
"return": [
],
"id": "libvirt-36"
}
{
"execute": "query-command-line-options",
"id": "libvirt-37"
}
{
"return": [
{
......@@ -5375,12 +5488,12 @@
"option": "drive"
}
],
"id": "libvirt-36"
"id": "libvirt-37"
}
{
"execute": "query-migrate-capabilities",
"id": "libvirt-37"
"id": "libvirt-38"
}
{
......@@ -5454,12 +5567,12 @@
"capability": "x-ignore-shared"
}
],
"id": "libvirt-37"
"id": "libvirt-38"
}
{
"execute": "query-qmp-schema",
"id": "libvirt-38"
"id": "libvirt-39"
}
{
......@@ -17738,5 +17851,5 @@
]
}
],
"id": "libvirt-38"
"id": "libvirt-39"
}
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册