From: Paolo Bonzini <pbonzini@redhat.com>
To: "Michael S. Tsirkin" <mst@redhat.com>, qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] [PATCH] pci-testdev: fast mmio support
Date: Thu, 24 Mar 2016 14:16:54 +0100 [thread overview]
Message-ID: <56F3E8C6.3020302@redhat.com> (raw)
In-Reply-To: <1458825035-21171-1-git-send-email-mst@redhat.com>
On 24/03/2016 14:10, Michael S. Tsirkin wrote:
> 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;
>
Acked-by: Paolo Bonzini <pbonzini@redhat.com>
prev parent reply other threads:[~2016-03-24 13:17 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-03-24 13:10 [Qemu-devel] [PATCH] pci-testdev: fast mmio support Michael S. Tsirkin
2016-03-24 13:16 ` Paolo Bonzini [this message]
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=56F3E8C6.3020302@redhat.com \
--to=pbonzini@redhat.com \
--cc=mst@redhat.com \
--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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.