Re: [RFC 4/8] virtio-pci: Batch add/del ioeventfds in a single MR transaction

2021-03-30 Thread Greg Kurz
On Mon, 29 Mar 2021 18:24:40 +0100 Stefan Hajnoczi wrote: > On Thu, Mar 25, 2021 at 04:07:31PM +0100, Greg Kurz wrote: > > diff --git a/softmmu/memory.c b/softmmu/memory.c > > index 1b1942d521cc..0279e5671bcb 100644 > > --- a/softmmu/memory.c > > +++ b/softmmu/memory.c > > @@ -2368,7 +2368,7 @@ v

Re: [RFC 4/8] virtio-pci: Batch add/del ioeventfds in a single MR transaction

2021-03-29 Thread Stefan Hajnoczi
On Thu, Mar 25, 2021 at 04:07:31PM +0100, Greg Kurz wrote: > diff --git a/softmmu/memory.c b/softmmu/memory.c > index 1b1942d521cc..0279e5671bcb 100644 > --- a/softmmu/memory.c > +++ b/softmmu/memory.c > @@ -2368,7 +2368,7 @@ void memory_region_add_eventfd_full(MemoryRegion *mr, > if (size) {

[RFC 4/8] virtio-pci: Batch add/del ioeventfds in a single MR transaction

2021-03-25 Thread Greg Kurz
Implement the ioeventfd_assign_begin() and ioeventfd_assign_commit() handlers of VirtioBusClass. Basically track that a transaction was already requested by the device and use this information to prevent the memory code to generate a transaction for each individual eventfd. Devices that want to be