From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1O6lls-0008WR-29 for qemu-devel@nongnu.org; Tue, 27 Apr 2010 10:28:20 -0400 Received: from [140.186.70.92] (port=59321 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1O6llq-0008VI-Mv for qemu-devel@nongnu.org; Tue, 27 Apr 2010 10:28:19 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1O6llp-0006X3-6o for qemu-devel@nongnu.org; Tue, 27 Apr 2010 10:28:18 -0400 Received: from mail-qy0-f188.google.com ([209.85.221.188]:55325) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1O6llp-0006Wo-3m for qemu-devel@nongnu.org; Tue, 27 Apr 2010 10:28:17 -0400 Received: by qyk26 with SMTP id 26so7071692qyk.19 for ; Tue, 27 Apr 2010 07:28:15 -0700 (PDT) MIME-Version: 1.0 Sender: camm@ualberta.ca In-Reply-To: <4BD5E16B.5010308@codemonkey.ws> References: <2e085c19aac78e6c4335eac4fffeb5cfca4bbb26.1272304746.git.mtosatti@redhat.com> <4BD5DB12.6020406@codemonkey.ws> <20100426184928.GF21425@amt.cnet> <4BD5E16B.5010308@codemonkey.ws> Date: Tue, 27 Apr 2010 08:28:15 -0600 Message-ID: From: Cam Macdonell Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Subject: [Qemu-devel] Re: [PATCH 10/10] introduce qemu_ram_map List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Anthony Liguori Cc: Anthony Liguori , Marcelo Tosatti , qemu-devel@nongnu.org, kvm@vger.kernel.org On Mon, Apr 26, 2010 at 12:54 PM, Anthony Liguori w= rote: > On 04/26/2010 01:49 PM, Marcelo Tosatti wrote: >> >> On Mon, Apr 26, 2010 at 01:27:30PM -0500, Anthony Liguori wrote: >> >>> >>> On 04/26/2010 12:59 PM, Marcelo Tosatti wrote: >>> >>>> >>>> Which allows drivers to register an mmaped region into ram block >>>> mappings. >>>> To be used by device assignment driver. >>>> >>> >>> This doesn't make much sense to me. >>> >>> Do you use this like: >>> >>> qemu_ram_map(64k, ptr); >>> assert(qemu_ram_alloc(64k) =3D=3D ptr); >>> >> >> No. hw/device-assignment.c in qemu-kvm mmaps >> /sys/bus/pci/devices/x:y:z/resourcen (the PCI devices memory regions) to >> the guest. >> > > I understand, but how do you use qemu_ram_map() to actually map that memo= ry > to a given PCI device resource? =A0I assume you rely on it getting put on= the > front of the list so that the next qemu_ram_alloc() will be at that > location. In my shared memory patch, I passed the offset returned from qemu_ram_mmap to cpu_register_physical_memory from within the map function passed to pci_register_bar. Could the same not be done? Is there something incorrect with this approach? > > Regards, > > Anthony Liguori > >>> If so, I think this is not the best API. =A0I'd rather see >>> qemu_ram_map() register a symbolic name for the region and for there >>> to be a qemu_ram_alloc() variant that allocated by name. >>> >>> Regards, >>> >>> Anthony Liguori >>> >>> > >