From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:33501) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SAi6o-0003k3-Vy for qemu-devel@nongnu.org; Thu, 22 Mar 2012 09:31:24 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1SAi6h-0001bK-6C for qemu-devel@nongnu.org; Thu, 22 Mar 2012 09:31:18 -0400 Received: from mx1.redhat.com ([209.132.183.28]:56495) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SAi6g-0001ap-Tn for qemu-devel@nongnu.org; Thu, 22 Mar 2012 09:31:11 -0400 Message-ID: <4F6B299A.501@redhat.com> Date: Thu, 22 Mar 2012 15:31:06 +0200 From: Avi Kivity MIME-Version: 1.0 References: <20120320123137.GA29666@redhat.com> <4F6B2911.8070904@siemens.com> In-Reply-To: <4F6B2911.8070904@siemens.com> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH] kvm: allow arbitrarily sized mmio ioeventfd List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Jan Kiszka Cc: Anthony Liguori , "Michael S. Tsirkin" , Marcelo Tosatti , qemu-devel@nongnu.org, Isaku Yamahata , Richard Henderson On 03/22/2012 03:28 PM, Jan Kiszka wrote: > 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 > > --- > > 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? > It won't, but it's hard to generate 3-byte writes (not impossible though). -- error compiling committee.c: too many arguments to function