All of lore.kernel.org
 help / color / mirror / Atom feed
From: Avi Kivity <avi@redhat.com>
To: Anthony Liguori <anthony@codemonkey.ws>
Cc: qemu-devel@nongnu.org, kvm@vger.kernel.org
Subject: Re: [Qemu-devel] [PATCH 11/23] memory: add ioeventfd support
Date: Tue, 26 Jul 2011 13:08:48 +0300	[thread overview]
Message-ID: <4E2E9230.5020302@redhat.com> (raw)
In-Reply-To: <4E2DBF24.20803@codemonkey.ws>

On 07/25/2011 10:08 PM, Anthony Liguori wrote:
>>
>> +static void as_memory_ioeventfd_add(AddressSpace *as, 
>> MemoryRegionIoeventfd *fd)
>> +{
>> +    int r;
>> +
>> +    if (!fd->match_data || fd->addr.size != 4) {
>> +        abort();
>> +    }
>> +
>> +    r = kvm_set_ioeventfd_mmio_long(fd->fd, fd->addr.start, 
>> fd->data, true);
>> +    if (r<  0) {
>> +        abort();
>> +    }
>
>
> asserts would be friendlier.

I thought asserts were disabled by default.  But I see it isn't so; will 
update.

>
> I really dislike baking ioeventfd into this API.  There is only one 
> user of ioeventfd in the tree.

Two: virtio-pci and ivshmem.

>
> I worry that by having things like ioeventfd the API, we're making it 
> too difficult to side-step the API which prevents future optimizations.
>
> I'd prefer virtio-pci to have ugliness in it where it circumvented the 
> layering vs. having such a device specific thing in generic code.

It's impossible (or at least, impossible without further information 
from the API) to do this and retain correctness.  Currently virtio-pci 
is broken wrt bridges and overlapping BARs; it's probably also broken on 
targets that bridge the I/O address space to MMIO.

With the memory API, this is fixed in a natural way by making the I/O 
address space a subregion of the bridge which does the conversion; the 
code will automatically add the needed offset and use MMIO ioeventfd 
instead of portio.

On a more general note, I don't want this to be a lean and mean API that 
throws any complexity to the users; instead I want to make writing 
devices as simple as possible and own all the smarts.

(an example - undecoded address bits can be specified to the API which 
then takes care of replication or shifting).

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


  reply	other threads:[~2011-07-26 10:08 UTC|newest]

Thread overview: 100+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-07-25 14:02 [PATCH 00/23] Memory API, batch 1 Avi Kivity
2011-07-25 14:02 ` [Qemu-devel] " Avi Kivity
2011-07-25 14:02 ` [PATCH 01/23] Hierarchical memory region API Avi Kivity
2011-07-25 14:02   ` [Qemu-devel] " Avi Kivity
2011-07-25 18:41   ` Anthony Liguori
2011-07-26  9:35     ` Avi Kivity
2011-07-25 14:02 ` [PATCH 02/23] memory: implement dirty tracking Avi Kivity
2011-07-25 14:02   ` [Qemu-devel] " Avi Kivity
2011-07-25 18:43   ` Anthony Liguori
2011-07-25 18:43     ` [Qemu-devel] " Anthony Liguori
2011-07-25 14:02 ` [PATCH 03/23] memory: merge adjacent segments of a single memory region Avi Kivity
2011-07-25 14:02   ` [Qemu-devel] " Avi Kivity
2011-07-25 18:48   ` Anthony Liguori
2011-07-26  9:55     ` Avi Kivity
2011-07-25 14:02 ` [PATCH 04/23] Internal interfaces for memory API Avi Kivity
2011-07-25 14:02   ` [Qemu-devel] " Avi Kivity
2011-07-25 18:49   ` Anthony Liguori
2011-07-25 14:02 ` [PATCH 05/23] memory: abstract address space operations Avi Kivity
2011-07-25 14:02   ` [Qemu-devel] " Avi Kivity
2011-07-25 18:51   ` Anthony Liguori
2011-07-25 14:02 ` [PATCH 06/23] memory: rename MemoryRegion::has_ram_addr to ::terminates Avi Kivity
2011-07-25 14:02   ` [Qemu-devel] " Avi Kivity
2011-07-25 18:56   ` Anthony Liguori
2011-07-26  9:59     ` Avi Kivity
2011-07-25 14:02 ` [PATCH 07/23] memory: late initialization of ram_addr Avi Kivity
2011-07-25 14:02   ` [Qemu-devel] " Avi Kivity
2011-07-25 14:02 ` [PATCH 08/23] memory: I/O address space support Avi Kivity
2011-07-25 14:02   ` [Qemu-devel] " Avi Kivity
2011-07-25 19:00   ` Anthony Liguori
2011-07-25 14:02 ` [PATCH 09/23] memory: add backward compatibility for old portio registration Avi Kivity
2011-07-25 14:02   ` [Qemu-devel] " Avi Kivity
2011-07-25 19:01   ` Anthony Liguori
2011-07-25 14:02 ` [PATCH 10/23] memory: add backward compatibility for old mmio registration Avi Kivity
2011-07-25 14:02   ` [Qemu-devel] " Avi Kivity
2011-07-25 19:02   ` Anthony Liguori
2011-07-25 14:02 ` [PATCH 11/23] memory: add ioeventfd support Avi Kivity
2011-07-25 14:02   ` [Qemu-devel] " Avi Kivity
2011-07-25 15:16   ` malc
2011-07-25 15:17     ` Avi Kivity
2011-07-25 15:17       ` [Qemu-devel] " Avi Kivity
2011-07-25 15:22       ` malc
2011-07-25 15:22         ` [Qemu-devel] " malc
2011-07-25 15:28         ` Avi Kivity
2011-07-25 15:38           ` malc
2011-07-25 15:43             ` Avi Kivity
2011-07-25 19:08   ` Anthony Liguori
2011-07-26 10:08     ` Avi Kivity [this message]
2011-07-25 14:02 ` [PATCH 12/23] memory: separate building the final memory map into two steps Avi Kivity
2011-07-25 14:02   ` [Qemu-devel] " Avi Kivity
2011-07-25 19:12   ` Anthony Liguori
2011-07-26 10:43     ` Avi Kivity
2011-07-26 10:43       ` [Qemu-devel] " Avi Kivity
2011-07-25 14:02 ` [PATCH 13/23] memory: document the memory API Avi Kivity
2011-07-25 14:02   ` [Qemu-devel] " Avi Kivity
2011-07-25 19:15   ` Anthony Liguori
2011-07-26 10:44     ` Avi Kivity
2011-07-25 14:02 ` [PATCH 14/23] memory: transaction API Avi Kivity
2011-07-25 14:02   ` [Qemu-devel] " Avi Kivity
2011-07-25 19:16   ` Anthony Liguori
2011-07-26 10:48     ` Avi Kivity
2011-07-26 11:39       ` Avi Kivity
2011-07-25 14:02 ` [PATCH 15/23] exec.c: initialize memory map Avi Kivity
2011-07-25 14:02   ` [Qemu-devel] " Avi Kivity
2011-07-25 19:17   ` Anthony Liguori
2011-07-26 10:55     ` Avi Kivity
2011-07-26 10:55       ` [Qemu-devel] " Avi Kivity
2011-07-25 14:02 ` [PATCH 16/23] ioport: register ranges by byte aligned addresses always Avi Kivity
2011-07-25 14:02   ` [Qemu-devel] " Avi Kivity
2011-07-25 19:20   ` Anthony Liguori
2011-07-26 10:59     ` Avi Kivity
2011-07-25 14:02 ` [PATCH 17/23] pc: grab system_memory Avi Kivity
2011-07-25 14:02   ` [Qemu-devel] " Avi Kivity
2011-07-25 19:22   ` Anthony Liguori
2011-07-25 14:02 ` [PATCH 18/23] pc: convert pc_memory_init() to memory API Avi Kivity
2011-07-25 14:02   ` [Qemu-devel] " Avi Kivity
2011-07-25 19:23   ` Anthony Liguori
2011-07-25 14:03 ` [PATCH 19/23] pc: move global memory map out of pc_init1() and into its callers Avi Kivity
2011-07-25 14:03   ` [Qemu-devel] " Avi Kivity
2011-07-25 20:02   ` Anthony Liguori
2011-07-26 11:02     ` Avi Kivity
2011-07-25 14:03 ` [PATCH 20/23] pci: pass address space to pci bus when created Avi Kivity
2011-07-25 14:03   ` [Qemu-devel] " Avi Kivity
2011-07-25 20:03   ` Anthony Liguori
2011-07-25 20:03     ` [Qemu-devel] " Anthony Liguori
2011-07-25 14:03 ` [PATCH 21/23] pci: add MemoryRegion based BAR management API Avi Kivity
2011-07-25 14:03   ` [Qemu-devel] " Avi Kivity
2011-07-25 20:20   ` Anthony Liguori
2011-07-25 20:20     ` [Qemu-devel] " Anthony Liguori
2011-07-26 11:06     ` Avi Kivity
2011-07-26 11:06       ` [Qemu-devel] " Avi Kivity
2011-07-25 14:03 ` [PATCH 22/23] sysbus: add MemoryRegion based memory " Avi Kivity
2011-07-25 14:03   ` [Qemu-devel] " Avi Kivity
2011-07-25 20:21   ` Anthony Liguori
2011-07-25 20:21     ` [Qemu-devel] " Anthony Liguori
2011-07-25 14:03 ` [PATCH 23/23] usb-ohci: convert to MemoryRegion Avi Kivity
2011-07-25 14:03   ` [Qemu-devel] " Avi Kivity
2011-07-25 20:22   ` Anthony Liguori
2011-07-25 20:23 ` [PATCH 00/23] Memory API, batch 1 Anthony Liguori
2011-07-25 20:23   ` [Qemu-devel] " Anthony Liguori
2011-07-26 11: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=4E2E9230.5020302@redhat.com \
    --to=avi@redhat.com \
    --cc=anthony@codemonkey.ws \
    --cc=kvm@vger.kernel.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 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.