2014-10-14 20:40:06 +04:00
|
|
|
#ifndef HW_COMPAT_H
|
|
|
|
#define HW_COMPAT_H
|
|
|
|
|
2017-04-03 18:41:33 +03:00
|
|
|
#define HW_COMPAT_2_9 \
|
2017-05-11 13:25:29 +03:00
|
|
|
{\
|
|
|
|
.driver = "pci-bridge",\
|
|
|
|
.property = "shpc",\
|
|
|
|
.value = "off",\
|
2017-05-19 06:19:48 +03:00
|
|
|
},{\
|
|
|
|
.driver = "intel-iommu",\
|
|
|
|
.property = "pt",\
|
|
|
|
.value = "off",\
|
2017-05-23 15:31:19 +03:00
|
|
|
},{\
|
|
|
|
.driver = "virtio-net-device",\
|
|
|
|
.property = "x-mtu-bypass-backend",\
|
|
|
|
.value = "off",\
|
2017-05-11 13:25:29 +03:00
|
|
|
},
|
2017-04-03 18:41:33 +03:00
|
|
|
|
2016-12-27 17:59:26 +03:00
|
|
|
#define HW_COMPAT_2_8 \
|
2017-01-12 21:24:17 +03:00
|
|
|
{\
|
|
|
|
.driver = "fw_cfg_mem",\
|
|
|
|
.property = "x-file-slots",\
|
|
|
|
.value = stringify(0x10),\
|
|
|
|
},{\
|
|
|
|
.driver = "fw_cfg_io",\
|
|
|
|
.property = "x-file-slots",\
|
|
|
|
.value = stringify(0x10),\
|
2017-01-27 18:20:22 +03:00
|
|
|
},{\
|
|
|
|
.driver = "pflash_cfi01",\
|
|
|
|
.property = "old-multiple-chip-handling",\
|
|
|
|
.value = "on",\
|
2017-01-25 11:44:46 +03:00
|
|
|
},{\
|
|
|
|
.driver = "pci-bridge",\
|
|
|
|
.property = "shpc",\
|
|
|
|
.value = "on",\
|
2017-02-20 23:43:10 +03:00
|
|
|
},{\
|
|
|
|
.driver = TYPE_PCI_DEVICE,\
|
|
|
|
.property = "x-pcie-extcap-init",\
|
|
|
|
.value = "off",\
|
2017-02-20 23:43:11 +03:00
|
|
|
},{\
|
|
|
|
.driver = "virtio-pci",\
|
|
|
|
.property = "x-pcie-deverr-init",\
|
|
|
|
.value = "off",\
|
2017-02-20 23:43:12 +03:00
|
|
|
},{\
|
|
|
|
.driver = "virtio-pci",\
|
|
|
|
.property = "x-pcie-lnkctl-init",\
|
|
|
|
.value = "off",\
|
2017-02-20 23:43:13 +03:00
|
|
|
},{\
|
|
|
|
.driver = "virtio-pci",\
|
|
|
|
.property = "x-pcie-pm-init",\
|
|
|
|
.value = "off",\
|
2017-03-14 15:28:34 +03:00
|
|
|
},{\
|
|
|
|
.driver = "cirrus-vga",\
|
|
|
|
.property = "vgamem_mb",\
|
|
|
|
.value = "8",\
|
|
|
|
},{\
|
|
|
|
.driver = "isa-cirrus-vga",\
|
|
|
|
.property = "vgamem_mb",\
|
|
|
|
.value = "8",\
|
2017-01-12 21:24:17 +03:00
|
|
|
},
|
2016-12-27 17:59:26 +03:00
|
|
|
|
2016-08-12 10:26:52 +03:00
|
|
|
#define HW_COMPAT_2_7 \
|
2016-09-07 18:02:25 +03:00
|
|
|
{\
|
|
|
|
.driver = "virtio-pci",\
|
|
|
|
.property = "page-per-vq",\
|
|
|
|
.value = "on",\
|
2016-09-27 16:43:37 +03:00
|
|
|
},{\
|
|
|
|
.driver = "virtio-serial-device",\
|
|
|
|
.property = "emergency-write",\
|
|
|
|
.value = "off",\
|
2016-09-23 08:33:15 +03:00
|
|
|
},{\
|
|
|
|
.driver = "ioapic",\
|
|
|
|
.property = "version",\
|
|
|
|
.value = "0x11",\
|
intel_iommu: reject broken EIM
Cluster x2APIC cannot work without KVM's x2apic API when the maximal
APIC ID is greater than 8 and only KVM's LAPIC can support x2APIC, so we
forbid other APICs and also the old KVM case with less than 9, to
simplify the code.
There is no point in enabling EIM in forbidden APICs, so we keep it
enabled only for the KVM APIC; unconditionally, because making the
option depend on KVM version would be a maintanance burden.
Old QEMUs would enable eim whenever intremap was on, which would trick
guests into thinking that they can enable cluster x2APIC even if any
interrupt destination would get clamped to 8 bits.
Depending on your configuration, QEMU could notice that the destination
LAPIC is not present and report it with a very non-obvious:
KVM: injection failed, MSI lost (Operation not permitted)
Or the guest could say something about unexpected interrupts, because
clamping leads to aliasing so interrupts were being delivered to
incorrect VCPUs.
KVM_X2APIC_API is the feature that allows us to enable EIM for KVM.
QEMU 2.7 allowed EIM whenever interrupt remapping was enabled. In order
to keep backward compatibility, we again allow guests to misbehave in
non-obvious ways, and make it the default for old machine types.
A user can enable the buggy mode it with "x-buggy-eim=on".
Signed-off-by: Radim Krčmář <rkrcmar@redhat.com>
Reviewed-by: Eduardo Habkost <ehabkost@redhat.com>
Reviewed-by: Peter Xu <peterx@redhat.com>
Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
2016-10-10 18:28:47 +03:00
|
|
|
},{\
|
|
|
|
.driver = "intel-iommu",\
|
|
|
|
.property = "x-buggy-eim",\
|
|
|
|
.value = "true",\
|
2016-12-14 19:30:35 +03:00
|
|
|
},{\
|
|
|
|
.driver = "virtio-pci",\
|
|
|
|
.property = "x-ignore-backend-features",\
|
|
|
|
.value = "on",\
|
2016-09-07 18:02:25 +03:00
|
|
|
},
|
2016-08-12 10:26:52 +03:00
|
|
|
|
2016-04-25 11:37:23 +03:00
|
|
|
#define HW_COMPAT_2_6 \
|
virtio-mmio: format transport base address in BusClass.get_dev_path
At the moment the following QEMU command line triggers an assertion
failure (minimal reproducer by Cole):
qemu-system-aarch64 \
-machine virt-2.6,accel=tcg \
-nodefaults \
-no-user-config \
-nographic -monitor stdio \
-device virtio-scsi-device,id=scsi0 \
-device virtio-scsi-device,id=scsi1 \
-drive file=foo.img,format=raw,if=none,id=d0 \
-device scsi-hd,bus=scsi0.0,drive=d0 \
-drive file=foo.img,format=raw,if=none,id=d1 \
-device scsi-hd,bus=scsi1.0,drive=d1
qemu-system-aarch64: migration/savevm.c:615:
vmstate_register_with_alias_id:
Assertion `!se->compat || se->instance_id == 0' failed.
The reason is that the vmstate sections for the two scsi-hd devices are
not uniquely identifiable by name.
The direct parent buses of the scsi-hd devices -- scsi0.0 and scsi1.0 --
support the BusClass.get_dev_path member function. scsibus_get_dev_path()
formats a device path prefix with the help of its topologically parent
bus, and then appends the chan:id:lun triplet to it. For both scsi-hd
devices, this triplet is 0:0:0.
(Here we use "device path" in the QEMU migration sense, for vmstate
section identification, not in the OFW or UEFI device path senses.)
The virtio-scsi HBA is plugged into the virtio-mmio bus (implemented by
the internal VirtIOMMIOProxy device). This bus class
(TYPE_VIRTIO_MMIO_BUS) inherits, as its get_dev_path() member function,
the virtio_bus_get_dev_path() method from its parent class
(TYPE_VIRTIO_BUS).
virtio_bus_get_dev_path() does not format any kind of device address on
its own; "virtio addresses" are transport-specific. Therefore
virtio_bus_get_dev_path() asks the topologically parent bus of the proxy
object (implementing the specific virtio transport) to format the address
of the proxy object.
(For virtio-pci devices (where the proxy is an instance of VirtIOPCIProxy,
plugged into a PCI bus), this ends up in pcibus_get_dev_path().)
However, VirtIOMMIOProxy is usually (in practice: always) plugged into
"main-system-bus", the singleton TYPE_SYSTEM_BUS object. This BusClass
does not support formatting QEMU vmstate device paths at all (as
SysBusDevice objects can have zero or more IO ports and zero or more MMIO
regions). Hence the formatting request delegated from
virtio_bus_get_dev_path() gets answered with NULL.
The end result is that the two scsi-hd devices end up with the same device
path "0:0:0", which triggers the assert.
We can solve this by recognizing that virtio-mmio transports are
distinguished from each other by their base addresses in MMIO address
space. Implement virtio_mmio_bus_get_dev_path() as follows:
(1) The virtio device whose devpath is to be formatted resides on a
virtio-mmio bus that is implemented by a VirtIOMMIOProxy object. Ask
the parent bus of VirtIOMMIOProxy to format the device path of
VirtIOMMIOProxy, as a path prefix. (This is identical to what
virtio_bus_get_dev_path() does.)
(2) Append the base address of VirtIOMMIOProxy to the device path, such
as:
- virtio-mmio@000000000a003e00,
- virtio-mmio@000000000a003c00.
Given that these device paths are placed in the migration stream, step (2)
above, if done unconditionally, would break migration. So make that step
conditional on a new VirtIOMMIOProxy property, which is enabled for 2.7
machine types and later.
Cc: "Michael S. Tsirkin" <mst@redhat.com>
Cc: Cole Robinson <crobinso@redhat.com>
Cc: Dr. David Alan Gilbert <dgilbert@redhat.com>
Cc: Kevin Zhao <kevin.zhao@linaro.org>
Cc: Peter Maydell <peter.maydell@linaro.org>
Cc: Tom Hanson <thomas.hanson@linaro.org>
Reported-by: Kevin Zhao <kevin.zhao@linaro.org>
Reviewed-by: Andrew Jones <drjones@redhat.com>
Signed-off-by: Laszlo Ersek <lersek@redhat.com>
Message-id: 1467739394-28357-1-git-send-email-lersek@redhat.com
Fixes: https://bugs.launchpad.net/qemu/+bug/1594239
Signed-off-by: Laszlo Ersek <lersek@redhat.com>
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
2016-07-14 18:51:36 +03:00
|
|
|
{\
|
|
|
|
.driver = "virtio-mmio",\
|
|
|
|
.property = "format_transport_address",\
|
|
|
|
.value = "off",\
|
2016-07-20 18:28:21 +03:00
|
|
|
},{\
|
|
|
|
.driver = "virtio-pci",\
|
|
|
|
.property = "disable-modern",\
|
|
|
|
.value = "on",\
|
|
|
|
},{\
|
|
|
|
.driver = "virtio-pci",\
|
|
|
|
.property = "disable-legacy",\
|
|
|
|
.value = "off",\
|
virtio-mmio: format transport base address in BusClass.get_dev_path
At the moment the following QEMU command line triggers an assertion
failure (minimal reproducer by Cole):
qemu-system-aarch64 \
-machine virt-2.6,accel=tcg \
-nodefaults \
-no-user-config \
-nographic -monitor stdio \
-device virtio-scsi-device,id=scsi0 \
-device virtio-scsi-device,id=scsi1 \
-drive file=foo.img,format=raw,if=none,id=d0 \
-device scsi-hd,bus=scsi0.0,drive=d0 \
-drive file=foo.img,format=raw,if=none,id=d1 \
-device scsi-hd,bus=scsi1.0,drive=d1
qemu-system-aarch64: migration/savevm.c:615:
vmstate_register_with_alias_id:
Assertion `!se->compat || se->instance_id == 0' failed.
The reason is that the vmstate sections for the two scsi-hd devices are
not uniquely identifiable by name.
The direct parent buses of the scsi-hd devices -- scsi0.0 and scsi1.0 --
support the BusClass.get_dev_path member function. scsibus_get_dev_path()
formats a device path prefix with the help of its topologically parent
bus, and then appends the chan:id:lun triplet to it. For both scsi-hd
devices, this triplet is 0:0:0.
(Here we use "device path" in the QEMU migration sense, for vmstate
section identification, not in the OFW or UEFI device path senses.)
The virtio-scsi HBA is plugged into the virtio-mmio bus (implemented by
the internal VirtIOMMIOProxy device). This bus class
(TYPE_VIRTIO_MMIO_BUS) inherits, as its get_dev_path() member function,
the virtio_bus_get_dev_path() method from its parent class
(TYPE_VIRTIO_BUS).
virtio_bus_get_dev_path() does not format any kind of device address on
its own; "virtio addresses" are transport-specific. Therefore
virtio_bus_get_dev_path() asks the topologically parent bus of the proxy
object (implementing the specific virtio transport) to format the address
of the proxy object.
(For virtio-pci devices (where the proxy is an instance of VirtIOPCIProxy,
plugged into a PCI bus), this ends up in pcibus_get_dev_path().)
However, VirtIOMMIOProxy is usually (in practice: always) plugged into
"main-system-bus", the singleton TYPE_SYSTEM_BUS object. This BusClass
does not support formatting QEMU vmstate device paths at all (as
SysBusDevice objects can have zero or more IO ports and zero or more MMIO
regions). Hence the formatting request delegated from
virtio_bus_get_dev_path() gets answered with NULL.
The end result is that the two scsi-hd devices end up with the same device
path "0:0:0", which triggers the assert.
We can solve this by recognizing that virtio-mmio transports are
distinguished from each other by their base addresses in MMIO address
space. Implement virtio_mmio_bus_get_dev_path() as follows:
(1) The virtio device whose devpath is to be formatted resides on a
virtio-mmio bus that is implemented by a VirtIOMMIOProxy object. Ask
the parent bus of VirtIOMMIOProxy to format the device path of
VirtIOMMIOProxy, as a path prefix. (This is identical to what
virtio_bus_get_dev_path() does.)
(2) Append the base address of VirtIOMMIOProxy to the device path, such
as:
- virtio-mmio@000000000a003e00,
- virtio-mmio@000000000a003c00.
Given that these device paths are placed in the migration stream, step (2)
above, if done unconditionally, would break migration. So make that step
conditional on a new VirtIOMMIOProxy property, which is enabled for 2.7
machine types and later.
Cc: "Michael S. Tsirkin" <mst@redhat.com>
Cc: Cole Robinson <crobinso@redhat.com>
Cc: Dr. David Alan Gilbert <dgilbert@redhat.com>
Cc: Kevin Zhao <kevin.zhao@linaro.org>
Cc: Peter Maydell <peter.maydell@linaro.org>
Cc: Tom Hanson <thomas.hanson@linaro.org>
Reported-by: Kevin Zhao <kevin.zhao@linaro.org>
Reviewed-by: Andrew Jones <drjones@redhat.com>
Signed-off-by: Laszlo Ersek <lersek@redhat.com>
Message-id: 1467739394-28357-1-git-send-email-lersek@redhat.com
Fixes: https://bugs.launchpad.net/qemu/+bug/1594239
Signed-off-by: Laszlo Ersek <lersek@redhat.com>
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
2016-07-14 18:51:36 +03:00
|
|
|
},
|
2016-04-25 11:37:23 +03:00
|
|
|
|
2015-11-30 17:56:36 +03:00
|
|
|
#define HW_COMPAT_2_5 \
|
2015-12-23 22:55:58 +03:00
|
|
|
{\
|
2016-01-22 23:51:05 +03:00
|
|
|
.driver = "isa-fdc",\
|
|
|
|
.property = "fallback",\
|
|
|
|
.value = "144",\
|
|
|
|
},{\
|
2015-12-23 22:55:58 +03:00
|
|
|
.driver = "pvscsi",\
|
|
|
|
.property = "x-old-pci-configuration",\
|
|
|
|
.value = "on",\
|
|
|
|
},{\
|
|
|
|
.driver = "pvscsi",\
|
|
|
|
.property = "x-disable-pcie",\
|
|
|
|
.value = "on",\
|
|
|
|
},\
|
2015-12-24 10:17:37 +03:00
|
|
|
{\
|
|
|
|
.driver = "vmxnet3",\
|
|
|
|
.property = "x-old-msi-offsets",\
|
|
|
|
.value = "on",\
|
2015-12-24 10:17:40 +03:00
|
|
|
},{\
|
|
|
|
.driver = "vmxnet3",\
|
|
|
|
.property = "x-disable-pcie",\
|
|
|
|
.value = "on",\
|
2015-12-24 10:17:37 +03:00
|
|
|
},
|
2015-11-30 17:56:36 +03:00
|
|
|
|
2015-09-11 23:14:25 +03:00
|
|
|
#define HW_COMPAT_2_4 \
|
2015-11-30 17:56:38 +03:00
|
|
|
{\
|
|
|
|
.driver = "virtio-blk-device",\
|
|
|
|
.property = "scsi",\
|
|
|
|
.value = "true",\
|
|
|
|
},{\
|
|
|
|
.driver = "e1000",\
|
|
|
|
.property = "extra_mac_registers",\
|
|
|
|
.value = "off",\
|
|
|
|
},{\
|
|
|
|
.driver = "virtio-pci",\
|
|
|
|
.property = "x-disable-pcie",\
|
|
|
|
.value = "on",\
|
|
|
|
},{\
|
|
|
|
.driver = "virtio-pci",\
|
|
|
|
.property = "migrate-extra",\
|
|
|
|
.value = "off",\
|
2016-02-18 22:31:00 +03:00
|
|
|
},{\
|
|
|
|
.driver = "fw_cfg_mem",\
|
|
|
|
.property = "dma_enabled",\
|
|
|
|
.value = "off",\
|
|
|
|
},{\
|
|
|
|
.driver = "fw_cfg_io",\
|
|
|
|
.property = "dma_enabled",\
|
|
|
|
.value = "off",\
|
2017-03-20 20:05:56 +03:00
|
|
|
},{\
|
|
|
|
.driver = "vmgenid",\
|
|
|
|
.property = "x-write-pointer-available",\
|
|
|
|
.value = "off",\
|
2015-11-30 17:56:38 +03:00
|
|
|
},
|
2015-09-11 23:14:25 +03:00
|
|
|
|
2015-05-14 21:53:02 +03:00
|
|
|
#define HW_COMPAT_2_3 \
|
2015-11-30 17:56:38 +03:00
|
|
|
{\
|
|
|
|
.driver = "virtio-blk-pci",\
|
|
|
|
.property = "any_layout",\
|
|
|
|
.value = "off",\
|
|
|
|
},{\
|
|
|
|
.driver = "virtio-balloon-pci",\
|
|
|
|
.property = "any_layout",\
|
|
|
|
.value = "off",\
|
|
|
|
},{\
|
|
|
|
.driver = "virtio-serial-pci",\
|
|
|
|
.property = "any_layout",\
|
|
|
|
.value = "off",\
|
|
|
|
},{\
|
|
|
|
.driver = "virtio-9p-pci",\
|
|
|
|
.property = "any_layout",\
|
|
|
|
.value = "off",\
|
|
|
|
},{\
|
|
|
|
.driver = "virtio-rng-pci",\
|
|
|
|
.property = "any_layout",\
|
|
|
|
.value = "off",\
|
2016-07-19 23:16:19 +03:00
|
|
|
},{\
|
|
|
|
.driver = TYPE_PCI_DEVICE,\
|
|
|
|
.property = "x-pcie-lnksta-dllla",\
|
|
|
|
.value = "off",\
|
2015-11-30 17:56:38 +03:00
|
|
|
},
|
2015-05-14 21:53:02 +03:00
|
|
|
|
|
|
|
#define HW_COMPAT_2_2 \
|
2015-11-30 17:56:38 +03:00
|
|
|
/* empty */
|
2015-05-14 21:53:02 +03:00
|
|
|
|
2014-10-14 20:40:06 +04:00
|
|
|
#define HW_COMPAT_2_1 \
|
2015-11-30 17:56:38 +03:00
|
|
|
{\
|
|
|
|
.driver = "intel-hda",\
|
|
|
|
.property = "old_msi_addr",\
|
|
|
|
.value = "on",\
|
|
|
|
},{\
|
|
|
|
.driver = "VGA",\
|
|
|
|
.property = "qemu-extended-regs",\
|
|
|
|
.value = "off",\
|
|
|
|
},{\
|
|
|
|
.driver = "secondary-vga",\
|
|
|
|
.property = "qemu-extended-regs",\
|
|
|
|
.value = "off",\
|
|
|
|
},{\
|
|
|
|
.driver = "virtio-scsi-pci",\
|
|
|
|
.property = "any_layout",\
|
|
|
|
.value = "off",\
|
|
|
|
},{\
|
|
|
|
.driver = "usb-mouse",\
|
|
|
|
.property = "usb_version",\
|
|
|
|
.value = stringify(1),\
|
|
|
|
},{\
|
|
|
|
.driver = "usb-kbd",\
|
|
|
|
.property = "usb_version",\
|
|
|
|
.value = stringify(1),\
|
|
|
|
},{\
|
|
|
|
.driver = "virtio-pci",\
|
|
|
|
.property = "virtio-pci-bus-master-bug-migration",\
|
|
|
|
.value = "on",\
|
|
|
|
},
|
2014-10-14 20:40:06 +04:00
|
|
|
|
|
|
|
#endif /* HW_COMPAT_H */
|