From mboxrd@z Thu Jan 1 00:00:00 1970 From: Eduardo Habkost Subject: Re: [PATCH V3 2/4] target-i386:add coalesced_pio API Date: Fri, 24 Aug 2018 07:42:46 -0300 Message-ID: <20180824104246.GU3778@localhost.localdomain> References: <201808241718451351057@zte.com.cn> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: zhong.weidong@zte.com.cn, kvm@vger.kernel.org, rkrcmar@redhat.com, mst@redhat.com, qemu-devel@nongnu.org, pbonzini@redhat.com To: peng.hao2@zte.com.cn Return-path: Content-Disposition: inline In-Reply-To: <201808241718451351057@zte.com.cn> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+gceq-qemu-devel2=m.gmane.org@nongnu.org Sender: "Qemu-devel" List-Id: kvm.vger.kernel.org On Fri, Aug 24, 2018 at 05:18:45PM +0800, peng.hao2@zte.com.cn wrote: [...] > > > - cpu_physical_memory_write(ent->phys_addr, ent->data, ent->len); > > > + if (ent->pio == 1) { > > > + address_space_rw(&address_space_io, ent->phys_addr, > > > + MEMTXATTRS_NONE, ent->data, ent->len, true); > > > Why exactly MEMTXATTRS_NONE is the right attrs argument here? > > Why MEMTXATTRS_UNSPECIFIED wouldn't work? > > I didn't notice MEMTXATTRS_NONE is the same as MEMTXATTRS_UNSPECIFIED. > MEMTXATTRS_NONE is redundant. They are not exactly the same (see below), but in either case I'm not sure it would make any difference for PIO. > >> + } else { > >> + cpu_physical_memory_write(ent->phys_addr, ent->data, ent->len); > >> + } > >> smp_wmb(); > >> ring->first = (ring->first + 1) % KVM_COALESCED_MMIO_MAX; > >> } > >> diff --git a/include/exec/memattrs.h b/include/exec/memattrs.h > >> index d4a1642..12fd64f 100644 > >> --- a/include/exec/memattrs.h > >> +++ b/include/exec/memattrs.h > >> @@ -45,7 +45,7 @@ typedef struct MemTxAttrs { > >> * from "didn't specify" if necessary). > >> */ > >> #define MEMTXATTRS_UNSPECIFIED ((MemTxAttrs) { .unspecified = 1 }) > >> - > >> +#define MEMTXATTRS_NONE ((MemTxAttrs) { 0 }) -- Eduardo