From mboxrd@z Thu Jan 1 00:00:00 1970 From: Anthony Liguori Subject: Re: [PATCH 10/10] introduce qemu_ram_map Date: Mon, 26 Apr 2010 13:54:35 -0500 Message-ID: <4BD5E16B.5010308@codemonkey.ws> References: <2e085c19aac78e6c4335eac4fffeb5cfca4bbb26.1272304746.git.mtosatti@redhat.com> <4BD5DB12.6020406@codemonkey.ws> <20100426184928.GF21425@amt.cnet> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: Anthony Liguori , qemu-devel@nongnu.org, kvm@vger.kernel.org, Cam Macdonell To: Marcelo Tosatti Return-path: Received: from mail-pv0-f174.google.com ([74.125.83.174]:61764 "EHLO mail-pv0-f174.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751362Ab0DZSyk (ORCPT ); Mon, 26 Apr 2010 14:54:40 -0400 Received: by pvg2 with SMTP id 2so570573pvg.19 for ; Mon, 26 Apr 2010 11:54:40 -0700 (PDT) In-Reply-To: <20100426184928.GF21425@amt.cnet> Sender: kvm-owner@vger.kernel.org List-ID: 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) == 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 memory to a given PCI device resource? I 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. Regards, Anthony Liguori >> If so, I think this is not the best API. I'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 >> >>