[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PULL 02/15] pci-testdev: fast mmio support
From: |
Michael S. Tsirkin |
Subject: |
[Qemu-devel] [PULL 02/15] pci-testdev: fast mmio support |
Date: |
Fri, 8 Apr 2016 11:02:09 +0300 |
Teach PCI testdev to use fast MMIO when kvm makes it available.
Before:
mmio-wildcard-eventfd:pci-mem 2271
After:
mmio-wildcard-eventfd:pci-mem 1218
Signed-off-by: Michael S. Tsirkin <address@hidden>
---
hw/misc/pci-testdev.c | 7 ++++++-
1 file changed, 6 insertions(+), 1 deletion(-)
diff --git a/hw/misc/pci-testdev.c b/hw/misc/pci-testdev.c
index 5df9089..2f2e989 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;
--
MST
- [Qemu-devel] [PULL 00/15] pci, virtio, acpi: fixes for 2.6, Michael S. Tsirkin, 2016/04/08
- [Qemu-devel] [PULL 01/15] acpi: Add missing GCC_FMT_ATTR, Michael S. Tsirkin, 2016/04/08
- [Qemu-devel] [PULL 02/15] pci-testdev: fast mmio support,
Michael S. Tsirkin <=
- [Qemu-devel] [PULL 04/15] Sort the fw_cfg file list, Michael S. Tsirkin, 2016/04/08
- [Qemu-devel] [PULL 03/15] xen: piix reuse pci generic class init function, Michael S. Tsirkin, 2016/04/08
- [Qemu-devel] [PULL 05/15] Migration: Add i82801b11 migration data, Michael S. Tsirkin, 2016/04/08
- [Qemu-devel] [PULL 06/15] virtio-balloon: reset the statistic timer to load device, Michael S. Tsirkin, 2016/04/08
- [Qemu-devel] [PULL 07/15] tests/bios-tables-test: fix assert, Michael S. Tsirkin, 2016/04/08
- [Qemu-devel] [PULL 08/15] virtio: make virtio_queue_notify_vq static, Michael S. Tsirkin, 2016/04/08
- [Qemu-devel] [PULL 09/15] virtio-blk: fix disabled mode, Michael S. Tsirkin, 2016/04/08
- [Qemu-devel] [PULL 10/15] virtio-scsi: fix disabled mode, Michael S. Tsirkin, 2016/04/08
- [Qemu-devel] [PULL 11/15] virtio: add aio handler, Michael S. Tsirkin, 2016/04/08
- [Qemu-devel] [PULL 13/15] virtio-scsi: use aio handler for data plane, Michael S. Tsirkin, 2016/04/08