Received: from [140.186.70.92] (port=58620 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Oam7b-0002Wq-Sp for qemu-devel@nongnu.org; Mon, 19 Jul 2010 04:54:49 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1Oam7a-0008EV-QJ for qemu-devel@nongnu.org; Mon, 19 Jul 2010 04:54:47 -0400 Received: from cantor2.suse.de ([195.135.220.15]:56636 helo=mx2.suse.de) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1Oam7a-0008EE-H6 for qemu-devel@nongnu.org; Mon, 19 Jul 2010 04:54:46 -0400 Subject: Re: [Qemu-devel] Question about qemu firmware configuration (fw_cfg) device Mime-Version: 1.0 (Apple Message framework v1078) Content-Type: text/plain; charset=us-ascii From: Alexander Graf In-Reply-To: <20100719084800.GI4689@redhat.com> Date: Mon, 19 Jul 2010 10:54:43 +0200 Content-Transfer-Encoding: quoted-printable Message-Id: <28292784-F194-43D8-A640-B0DCAB0CF940@suse.de> References: <20100719073312.GY4689@redhat.com> <4E9BBBA5-F2D1-4485-AFD3-8D6FDE3A3CCC@suse.de> <20100719075110.GB4689@redhat.com> <77A267F6-3646-4F22-B837-E1E7DBA06950@suse.de> <20100719080142.GE4689@redhat.com> <20100719081954.GF4689@redhat.com> <43B9EAA8-E3F5-4903-896C-DEBD90E06162@suse.de> <20100719083050.GG4689@redhat.com> <51B0CBDB-E40B-4A14-A33E-34E13B9BF3CB@suse.de> <20100719084800.GI4689@redhat.com> List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Gleb Natapov Cc: "Richard W.M. Jones" , qemu-devel@nongnu.org On 19.07.2010, at 10:48, Gleb Natapov wrote: > On Mon, Jul 19, 2010 at 10:41:48AM +0200, Alexander Graf wrote: >>=20 >> On 19.07.2010, at 10:30, Gleb Natapov wrote: >>=20 >>> On Mon, Jul 19, 2010 at 10:24:46AM +0200, Alexander Graf wrote: >>>>=20 >>>> On 19.07.2010, at 10:19, Gleb Natapov wrote: >>>>=20 >>>> Yes and no. It sounds nice at first, but doesn't quite fit. There = are two issues: >>>>=20 >>>> 1) We need a new PCI ID >>> We have our range. We can allocate from there. >>>=20 >>>> 2) There can be a lot of initrd binaries with multiboot. We only = have a limited amount of BARs >>>>=20 >>> Is it supported now with fw_cfg interface? My main concern with this >>> approach is huge BAR size that may take a lot of space from PCI MMIO = range >>> if guest OS decide to configure it. >>=20 >> Oh, right. I think I combined all the modules into the INITRD blob. = Yeah, that would work. Is coalesced MMIO more efficient than coalesced = PIO? Or do we have to do some RAM mapping for those special BAR regions? >>=20 > I think we will have to do RAM mapping. Otherwise it may be slow to. > Coalesced MMIO is for write not read IIRC. Oh, right. Makes sense. >=20 >> Were there DMA capable devices back in ISA times? There must be. If = so, we can just take a look at what they do and do it similarly. Bus = mastering was a new thing for PCI, right? >>=20 > I think IDE can be considered DMA capable ISA device, no? At least > it works by writing to PIO ports and getting result into memory, but > with interrupts and status bits and everything that real device should > have. On board DMA engine is also ISA device.=20 We could define our device to be polling. So all we need is a status bit = that the guest sets when it starts the DMA and the device unsets when = the DMA is done. In our case that should be immediate, because the PIO = invokes the full code paths, but it would look more like a real device, = no? outb(PORT_DMA_CTL, FWCFG_DMA_ENABLE); while (inb(PORT_DMA_CTL) & FWCFG_DMA_ENABLE) { /* DMA going on */ } /* DMA done */ Alex