qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Jan Kiszka <jan.kiszka@siemens.com>
To: "Michael S. Tsirkin" <mst@redhat.com>
Cc: Anthony Liguori <aliguori@us.ibm.com>,
	Marcelo Tosatti <mtosatti@redhat.com>,
	qemu-devel@nongnu.org, Isaku Yamahata <yamahata@valinux.co.jp>,
	Avi Kivity <avi@redhat.com>, Richard Henderson <rth@twiddle.net>
Subject: Re: [Qemu-devel] [PATCH] kvm: allow arbitrarily sized mmio ioeventfd
Date: Thu, 22 Mar 2012 14:28:49 +0100	[thread overview]
Message-ID: <4F6B2911.8070904@siemens.com> (raw)
In-Reply-To: <20120320123137.GA29666@redhat.com>

On 2012-03-20 13:31, Michael S. Tsirkin wrote:
> We use a 2 byte ioeventfd for virtio memory,
> add support for this.
> 
> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
> ---
>  hw/ivshmem.c |    8 ++++----
>  kvm-all.c    |   15 ++++++++-------
>  kvm-stub.c   |    2 +-
>  kvm.h        |    3 ++-
>  4 files changed, 15 insertions(+), 13 deletions(-)
> 
> diff --git a/hw/ivshmem.c b/hw/ivshmem.c
> index 5ebf840..f02530c 100644
> --- a/hw/ivshmem.c
> +++ b/hw/ivshmem.c
> @@ -354,8 +354,8 @@ static void close_guest_eventfds(IVShmemState *s, int posn)
>      guest_curr_max = s->peers[posn].nb_eventfds;
>  
>      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_mmio(s->peers[posn].eventfds[i],
> +                    s->mmio_addr + DOORBELL, (posn << 16) | i, 0, 4);
>          close(s->peers[posn].eventfds[i]);
>      }
>  
> @@ -500,8 +500,8 @@ static void ivshmem_read(void *opaque, const uint8_t * buf, int flags)
>      }
>  
>      if (ivshmem_has_feature(s, IVSHMEM_IOEVENTFD)) {
> -        if (kvm_set_ioeventfd_mmio_long(incoming_fd, s->mmio_addr + DOORBELL,
> -                        (incoming_posn << 16) | guest_max_eventfd, 1) < 0) {
> +        if (kvm_set_ioeventfd_mmio(incoming_fd, s->mmio_addr + DOORBELL,
> +                        (incoming_posn << 16) | guest_max_eventfd, 1, 4) < 0) {
>              fprintf(stderr, "ivshmem: ioeventfd not available\n");
>          }
>      }
> diff --git a/kvm-all.c b/kvm-all.c
> index 42e5e23..bcf0dbe 100644
> --- a/kvm-all.c
> +++ b/kvm-all.c
> @@ -744,10 +744,10 @@ static void kvm_mem_ioeventfd_add(MemoryRegionSection *section,
>  {
>      int r;
>  
> -    assert(match_data && section->size == 4);
> +    assert(match_data && section->size <= 8);

Probably nitpicking, but does it also work with non-power-of-two sizes?

Jan

-- 
Siemens AG, Corporate Technology, CT T DE IT 1
Corporate Competence Center Embedded Linux

  parent reply	other threads:[~2012-03-22 13:29 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-03-20 12:31 [Qemu-devel] [PATCH] kvm: allow arbitrarily sized mmio ioeventfd Michael S. Tsirkin
2012-03-21 23:34 ` Amos Kong
2012-03-22 13:28 ` Jan Kiszka
2012-03-22 13:28 ` Jan Kiszka [this message]
2012-03-22 13:31   ` Avi Kivity
2012-03-22 13:32 ` Avi Kivity

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=4F6B2911.8070904@siemens.com \
    --to=jan.kiszka@siemens.com \
    --cc=aliguori@us.ibm.com \
    --cc=avi@redhat.com \
    --cc=mst@redhat.com \
    --cc=mtosatti@redhat.com \
    --cc=qemu-devel@nongnu.org \
    --cc=rth@twiddle.net \
    --cc=yamahata@valinux.co.jp \
    /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).