From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:41294) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VWppF-0006sv-9s for qemu-devel@nongnu.org; Thu, 17 Oct 2013 11:49:30 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VWpoz-0000ib-9r for qemu-devel@nongnu.org; Thu, 17 Oct 2013 11:49:25 -0400 Received: from mail-ee0-x231.google.com ([2a00:1450:4013:c00::231]:38913) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VWpoz-0000iM-16 for qemu-devel@nongnu.org; Thu, 17 Oct 2013 11:49:09 -0400 Received: by mail-ee0-f49.google.com with SMTP id d41so1173414eek.36 for ; Thu, 17 Oct 2013 08:49:08 -0700 (PDT) Sender: Paolo Bonzini From: Paolo Bonzini Date: Thu, 17 Oct 2013 17:48:41 +0200 Message-Id: <1382024935-28297-4-git-send-email-pbonzini@redhat.com> In-Reply-To: <1382024935-28297-1-git-send-email-pbonzini@redhat.com> References: <1382024935-28297-1-git-send-email-pbonzini@redhat.com> Subject: [Qemu-devel] [PULL 03/17] portio: Allow to mark portio lists as coalesced MMIO flushing List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: Jan Kiszka From: Jan Kiszka This will enable us to remove all remaining explicit calls of qemu_flush_coalesced_mmio_buffer in IO handlers. Signed-off-by: Jan Kiszka Signed-off-by: Paolo Bonzini --- include/exec/ioport.h | 2 ++ ioport.c | 9 +++++++++ 2 files changed, 11 insertions(+) diff --git a/include/exec/ioport.h b/include/exec/ioport.h index b3848be..3bd6722 100644 --- a/include/exec/ioport.h +++ b/include/exec/ioport.h @@ -64,11 +64,13 @@ typedef struct PortioList { struct MemoryRegion **regions; void *opaque; const char *name; + bool flush_coalesced_mmio; } PortioList; void portio_list_init(PortioList *piolist, Object *owner, const struct MemoryRegionPortio *callbacks, void *opaque, const char *name); +void portio_list_set_flush_coalesced(PortioList *piolist); void portio_list_destroy(PortioList *piolist); void portio_list_add(PortioList *piolist, struct MemoryRegion *address_space, diff --git a/ioport.c b/ioport.c index 707cce8..3d91e79 100644 --- a/ioport.c +++ b/ioport.c @@ -139,6 +139,12 @@ void portio_list_init(PortioList *piolist, piolist->opaque = opaque; piolist->owner = owner; piolist->name = name; + piolist->flush_coalesced_mmio = false; +} + +void portio_list_set_flush_coalesced(PortioList *piolist) +{ + piolist->flush_coalesced_mmio = true; } void portio_list_destroy(PortioList *piolist) @@ -231,6 +237,9 @@ static void portio_list_add_1(PortioList *piolist, */ memory_region_init_io(&mrpio->mr, piolist->owner, &portio_ops, mrpio, piolist->name, off_high - off_low); + if (piolist->flush_coalesced_mmio) { + memory_region_set_flush_coalesced(&mrpio->mr); + } memory_region_add_subregion(piolist->address_space, start + off_low, &mrpio->mr); piolist->regions[piolist->nr] = &mrpio->mr; -- 1.8.3.1