From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:38952) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UNmEA-0000eV-3D for qemu-devel@nongnu.org; Thu, 04 Apr 2013 11:37:29 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UNmE3-0003Xh-Uw for qemu-devel@nongnu.org; Thu, 04 Apr 2013 11:37:26 -0400 Received: from mx1.redhat.com ([209.132.183.28]:13096) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UNmE3-0003Xa-Lm for qemu-devel@nongnu.org; Thu, 04 Apr 2013 11:37:19 -0400 Date: Thu, 4 Apr 2013 17:38:20 +0300 From: "Michael S. Tsirkin" Message-ID: <20130404143819.GM6467@redhat.com> References: <183f242d45ed0e10dd6feb73fd3f434738c08ae4.1365071407.git.mst@redhat.com> <515D7613.4010805@redhat.com> <20130404131015.GF6467@redhat.com> <515D948B.8080407@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <515D948B.8080407@redhat.com> Subject: Re: [Qemu-devel] [PATCH v2 5/6] kvm: add PV MMIO List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Paolo Bonzini Cc: gleb@redhat.com, mtosatti@redhat.com, qemu-devel@nongnu.org, kvm@vger.kernel.org, Avi Kivity On Thu, Apr 04, 2013 at 04:56:11PM +0200, Paolo Bonzini wrote: > Il 04/04/2013 15:10, Michael S. Tsirkin ha scritto: > > > I would like Avi to comment on this, because I think this is not the > > > "memory-API approved" way of doing things. You need KVM to define its > > > own AddressSpace, and make KVM's listener use > > > memory_region_to_address_space to figure out if it is for PV MMIO. > > > > > > To handle accesses from TCG, the PV AddressSpace can simply have just an > > > alias to the actual MemoryRegion where the doorbell is. > > > > This is not really different from other eventfd flags like datamatch. > > Separate address space is not appropriate here. > > This is regular memory space, KVM eventfd simply has a flag that says > > "guest is well behaved so please make eventfd go faster". > > Having a separate address space would match what you do in the kernel > though. Not really, in kernel the device is as usual on the MMIO bus. The pv_mmio_bus is an extra datastructure to enable lookups where length is not known in an efficient way. Userspace does not need to know about these details. > I just don't like functions with a dozen arguments... Can you just make > datamatch and pv a single flags argument, as is the case with the KVM API? > > Paolo Extra parameters are detected by compiler :) I don't really care, anyone else objects to changing datamatch to a flags argument? Please let me know to avoid changing it back and forth. -- MST