summaryrefslogtreecommitdiffstats
path: root/hw/misc/pci-testdev.c
diff options
context:
space:
mode:
authorPeter Maydell2016-04-08 13:45:53 +0200
committerPeter Maydell2016-04-08 13:45:53 +0200
commit8227e2d16705b8c94df93f465d4e1659c28c69ce (patch)
tree6d96c8b445f7eee8ca3c723f65362032bd3bbb10 /hw/misc/pci-testdev.c
parentMerge remote-tracking branch 'remotes/dgibson/tags/ppc-for-2.6-20160408' into... (diff)
parenthw/pci-bridge: Add missing unref in case register-bus fails (diff)
downloadqemu-8227e2d16705b8c94df93f465d4e1659c28c69ce.tar.gz
qemu-8227e2d16705b8c94df93f465d4e1659c28c69ce.tar.xz
qemu-8227e2d16705b8c94df93f465d4e1659c28c69ce.zip
Merge remote-tracking branch 'remotes/mst/tags/for_upstream' into staging
pci, virtio, acpi: fixes for 2.6 Fixes all over the place. Most notably, fixes migration for systems with pci express bridges, and random crashes observed with virtio blk and scsi dataplane. Signed-off-by: Michael S. Tsirkin <mst@redhat.com> # gpg: Signature made Fri 08 Apr 2016 08:53:46 BST using RSA key ID D28D5469 # gpg: Good signature from "Michael S. Tsirkin <mst@kernel.org>" # gpg: aka "Michael S. Tsirkin <mst@redhat.com>" * remotes/mst/tags/for_upstream: hw/pci-bridge: Add missing unref in case register-bus fails virtio: merge virtio_queue_aio_set_host_notifier_handler with virtio_queue_set_aio virtio-scsi: use aio handler for data plane virtio-blk: use aio handler for data plane virtio: add aio handler virtio-scsi: fix disabled mode virtio-blk: fix disabled mode virtio: make virtio_queue_notify_vq static tests/bios-tables-test: fix assert virtio-balloon: reset the statistic timer to load device Migration: Add i82801b11 migration data Sort the fw_cfg file list xen: piix reuse pci generic class init function pci-testdev: fast mmio support acpi: Add missing GCC_FMT_ATTR Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Diffstat (limited to 'hw/misc/pci-testdev.c')
-rw-r--r--hw/misc/pci-testdev.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/hw/misc/pci-testdev.c b/hw/misc/pci-testdev.c
index 5df9089218..2f2e989778 100644
--- a/hw/misc/pci-testdev.c
+++ b/hw/misc/pci-testdev.c
@@ -239,6 +239,7 @@ static void pci_testdev_realize(PCIDevice *pci_dev, Error **errp)
uint8_t *pci_conf;
char *name;
int r, i;
+ bool fastmmio = kvm_ioeventfd_any_length_enabled();
pci_conf = pci_dev->config;
@@ -261,8 +262,12 @@ static void pci_testdev_realize(PCIDevice *pci_dev, Error **errp)
memcpy(test->hdr->name, name, strlen(name) + 1);
g_free(name);
test->hdr->offset = cpu_to_le32(IOTEST_SIZE(i) + i * IOTEST_ACCESS_WIDTH);
- test->size = IOTEST_ACCESS_WIDTH;
test->match_data = strcmp(IOTEST_TEST(i), "wildcard-eventfd");
+ if (fastmmio && IOTEST_IS_MEM(i) && !test->match_data) {
+ test->size = 0;
+ } else {
+ test->size = IOTEST_ACCESS_WIDTH;
+ }
test->hdr->test = i;
test->hdr->data = test->match_data ? IOTEST_DATAMATCH : IOTEST_NOMATCH;
test->hdr->width = IOTEST_ACCESS_WIDTH;