From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([140.186.70.92]:37473) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QMyDX-0000Yw-Lu for qemu-devel@nongnu.org; Thu, 19 May 2011 04:04:24 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1QMyDW-0002XJ-LU for qemu-devel@nongnu.org; Thu, 19 May 2011 04:04:23 -0400 Received: from mx1.redhat.com ([209.132.183.28]:47139) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QMyDW-0002Wo-9i for qemu-devel@nongnu.org; Thu, 19 May 2011 04:04:22 -0400 Message-ID: <4DD4CEFD.2070404@redhat.com> Date: Thu, 19 May 2011 11:04:13 +0300 From: Avi Kivity MIME-Version: 1.0 References: <4DD3C5B9.1080908@redhat.com> <4DD3D236.90708@siemens.com> <4DD3D95E.2060105@redhat.com> <4DD3E1B3.3020405@siemens.com> <4DD3E47F.9060104@redhat.com> <4DD3E782.8090208@siemens.com> <4DD3E8D6.6090807@redhat.com> <4DD3ED22.6080005@siemens.com> <4DD3F055.6000905@redhat.com> <4DD3F626.7060500@siemens.com> <4DD3F83E.4090700@redhat.com> <4DD4286A.2030408@twiddle.net> In-Reply-To: <4DD4286A.2030408@twiddle.net> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [RFC] Memory API List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Richard Henderson Cc: Jan Kiszka , qemu-devel On 05/18/2011 11:13 PM, Richard Henderson wrote: > On 05/18/2011 09:47 AM, Avi Kivity wrote: > > Yes. We'd change pci_register_bar() to accept a MemoryRegion. > > Surely this detail would be hidden on the pci_dev->bus? Not sure what you mean. The reason I want pci_register_bar() to accept a memory region is that some BARs are composed of multiple subregions, for example cirrus has a RAM framebuffer an an mmio region in one BAR. So the device describes the region relative to its start point and hands it off to the pci subsystem, which can then enable or disable the region, and place it anywhere in the bus address space it likes. > >> However, we are yet in troubles if we want to change that because > >> devices can only be on one bus - at least so far. > > > > Nothing prohibits a device from calling pci_register_bar() for one region and some other API for another. > > Sure, but the majority of PCI devices are plain pci, and > that sort of complexity should be hidden by default. There is pci_register_bar_simple(). -- error compiling committee.c: too many arguments to function