qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Avi Kivity <avi@redhat.com>
To: zanghongyong@huawei.com
Cc: wusongwei@huawei.com, kvm@vger.kernel.org, hanweidong@huawei.com,
	qemu-devel@nongnu.org, wuchangyi@huawei.com,
	xiaowei.yang@huawei.com, james.chenjiabo@huawei.com,
	louzhengwei@huawei.com, cam@cs.ualberta.ca
Subject: Re: [Qemu-devel] [PATCH v2] ivshmem: add a new PIO BAR3(Doorbell) besides MMIO BAR0 to reduce notification time
Date: Sun, 20 Nov 2011 11:27:31 +0200	[thread overview]
Message-ID: <4EC8C803.70306@redhat.com> (raw)
In-Reply-To: <1321595404-2127-1-git-send-email-zanghongyong@huawei.com>

On 11/18/2011 07:50 AM, zanghongyong@huawei.com wrote:
> From: Hongyong Zang <zanghongyong@huawei.com>
>
> This patch, adds a PIO BAR3 for guest notifying qemu. And we find the new notification way of PIO BAR3 reduces 30% time in comparison with the original MMIO BAR0 way.

Please update the spec, and split the patch into an infrastructure patch
(for long eventfds in the memory API) and an ivshmem patch.

>  
>  //#define DEBUG_IVSHMEM
>  #ifdef DEBUG_IVSHMEM
> @@ -57,8 +58,10 @@ typedef struct IVShmemState {
>      CharDriverState **eventfd_chr;
>      CharDriverState *server_chr;
>      MemoryRegion ivshmem_mmio;
> +    MemoryRegion ivshmem_pio;
>  
>      pcibus_t mmio_addr;
> +    pcibus_t pio_addr;
>      /* We might need to register the BAR before we actually have the memory.
>       * So prepare a container MemoryRegion for the BAR immediately and
>       * add a subregion when we have the memory.
> @@ -234,7 +237,7 @@ static uint64_t ivshmem_io_read(void *opaque, target_phys_addr_t addr,
>      return ret;
>  }
>  
> -static const MemoryRegionOps ivshmem_mmio_ops = {
> +static const MemoryRegionOps ivshmem_io_ops = {
>      .read = ivshmem_io_read,
>      .write = ivshmem_io_write,
>      .endianness = DEVICE_NATIVE_ENDIAN,
> @@ -348,6 +351,8 @@ static void close_guest_eventfds(IVShmemState *s, int posn)
>      for (i = 0; i < guest_curr_max; i++) {
>          kvm_set_ioeventfd_mmio_long(s->peers[posn].eventfds[i],
>                      s->mmio_addr + DOORBELL, (posn << 16) | i, 0);
> +        kvm_set_ioeventfd_pio_long(s->peers[posn].eventfds[i],
> +                    s->pio_addr + DOORBELL, (posn << 16) | i, 0);

This really shouldn't be needed - the memory API should take care of it.

>          close(s->peers[posn].eventfds[i]);
>      }
>  
> @@ -367,6 +372,12 @@ static void setup_ioeventfds(IVShmemState *s) {
>                                        true,
>                                        (i << 16) | j,
>                                        s->peers[i].eventfds[j]);
> +            memory_region_add_eventfd(&s->ivshmem_pio,
> +                                      DOORBELL,
> +                                      4,
> +                                      true,
> +                                      (i << 16) | j,
> +                                      s->peers[i].eventfds[j]);
>          }
>      }

Where is the memory API support for this?

>  }
> @@ -495,6 +506,10 @@ static void ivshmem_read(void *opaque, const uint8_t * buf, int flags)
>                          (incoming_posn << 16) | guest_max_eventfd, 1) < 0) {
>              fprintf(stderr, "ivshmem: ioeventfd not available\n");
>          }
> +        if (kvm_set_ioeventfd_pio_long(incoming_fd, s->pio_addr + DOORBELL,
> +                        (incoming_posn << 16) | guest_max_eventfd, 1) < 0) {
> +            fprintf(stderr, "ivshmem: ioeventfd not available\n");
> +        }
>      }

Nor should this be needed.

Please make BAR 3 disappear if started with -M pc-1.0.


-- 
error compiling committee.c: too many arguments to function

  reply	other threads:[~2011-11-20 10:05 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-11-18  5:50 [Qemu-devel] [PATCH v2] ivshmem: add a new PIO BAR3(Doorbell) besides MMIO BAR0 to reduce notification time zanghongyong
2011-11-20  9:27 ` Avi Kivity [this message]
2011-11-29  6:38 ` Cam Macdonell
2011-11-29  7:02   ` Zang Hongyong

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=4EC8C803.70306@redhat.com \
    --to=avi@redhat.com \
    --cc=cam@cs.ualberta.ca \
    --cc=hanweidong@huawei.com \
    --cc=james.chenjiabo@huawei.com \
    --cc=kvm@vger.kernel.org \
    --cc=louzhengwei@huawei.com \
    --cc=qemu-devel@nongnu.org \
    --cc=wuchangyi@huawei.com \
    --cc=wusongwei@huawei.com \
    --cc=xiaowei.yang@huawei.com \
    --cc=zanghongyong@huawei.com \
    /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).