From: "Michael S. Tsirkin" <mst@redhat.com>
To: qemu-devel@nongnu.org
Cc: Peter Maydell <peter.maydell@linaro.org>
Subject: [Qemu-devel] [PULL 02/15] pci-testdev: fast mmio support
Date: Fri, 8 Apr 2016 11:02:09 +0300 [thread overview]
Message-ID: <1460102154-16096-3-git-send-email-mst@redhat.com> (raw)
In-Reply-To: <1460102154-16096-1-git-send-email-mst@redhat.com>
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 <mst@redhat.com>
---
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
next prev parent reply other threads:[~2016-04-08 8:02 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-04-08 8:02 [Qemu-devel] [PULL 00/15] pci, virtio, acpi: fixes for 2.6 Michael S. Tsirkin
2016-04-08 8:02 ` [Qemu-devel] [PULL 01/15] acpi: Add missing GCC_FMT_ATTR Michael S. Tsirkin
2016-04-08 8:02 ` Michael S. Tsirkin [this message]
2016-04-08 8:02 ` [Qemu-devel] [PULL 03/15] xen: piix reuse pci generic class init function Michael S. Tsirkin
2016-04-08 8:02 ` [Qemu-devel] [PULL 04/15] Sort the fw_cfg file list Michael S. Tsirkin
2016-04-08 8:02 ` [Qemu-devel] [PULL 05/15] Migration: Add i82801b11 migration data Michael S. Tsirkin
2016-04-08 8:02 ` [Qemu-devel] [PULL 06/15] virtio-balloon: reset the statistic timer to load device Michael S. Tsirkin
2016-04-08 8:02 ` [Qemu-devel] [PULL 07/15] tests/bios-tables-test: fix assert Michael S. Tsirkin
2016-04-08 8:02 ` [Qemu-devel] [PULL 08/15] virtio: make virtio_queue_notify_vq static Michael S. Tsirkin
2016-04-08 8:02 ` [Qemu-devel] [PULL 09/15] virtio-blk: fix disabled mode Michael S. Tsirkin
2016-04-08 8:02 ` [Qemu-devel] [PULL 10/15] virtio-scsi: " Michael S. Tsirkin
2016-04-08 8:02 ` [Qemu-devel] [PULL 11/15] virtio: add aio handler Michael S. Tsirkin
2016-04-08 8:02 ` [Qemu-devel] [PULL 12/15] virtio-blk: use aio handler for data plane Michael S. Tsirkin
2016-04-08 8:02 ` [Qemu-devel] [PULL 13/15] virtio-scsi: " Michael S. Tsirkin
2016-04-08 8:02 ` [Qemu-devel] [PULL 14/15] virtio: merge virtio_queue_aio_set_host_notifier_handler with virtio_queue_set_aio Michael S. Tsirkin
2016-04-08 8:02 ` [Qemu-devel] [PULL 15/15] hw/pci-bridge: Add missing unref in case register-bus fails Michael S. Tsirkin
2016-04-08 12:45 ` [Qemu-devel] [PULL 00/15] pci, virtio, acpi: fixes for 2.6 Peter Maydell
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1460102154-16096-3-git-send-email-mst@redhat.com \
--to=mst@redhat.com \
--cc=peter.maydell@linaro.org \
--cc=qemu-devel@nongnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).