Received: from eggs.gnu.org ([2001:4830:134:3::10]:55221) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZHxem-0003Sc-MR for qemu-devel@nongnu.org; Wed, 22 Jul 2015 13:18:13 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZHxeh-0001OB-MV for qemu-devel@nongnu.org; Wed, 22 Jul 2015 13:18:12 -0400 Received: from mail-qk0-f174.google.com ([209.85.220.174]:35106) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZHxeh-0001O4-Io for qemu-devel@nongnu.org; Wed, 22 Jul 2015 13:18:07 -0400 Received: by qkbm65 with SMTP id m65so103271846qkb.2 for ; Wed, 22 Jul 2015 10:18:07 -0700 (PDT) Date: Wed, 22 Jul 2015 13:18:04 -0400 From: Kevin O'Connor Message-ID: <20150722171804.GA2717@morn.localdomain> References: <1437494626-3773-1-git-send-email-markmb@redhat.com> <1437494626-3773-3-git-send-email-markmb@redhat.com> <20150722042434.GB27877@morn.localdomain> <20150722103112.1d97386b@markmb_rh> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20150722103112.1d97386b@markmb_rh> Subject: Re: [Qemu-devel] [RFC 2/7] fw_cfg dma interface List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Marc =?iso-8859-1?Q?Mar=ED?= Cc: Stefan Hajnoczi , Paolo Bonzini , Gerd Hoffmann , qemu-devel@nongnu.org On Wed, Jul 22, 2015 at 10:31:12AM +0200, Marc Marí wrote: > On Wed, 22 Jul 2015 00:24:34 -0400 > "Kevin O'Connor" wrote: > > On Tue, Jul 21, 2015 at 06:03:41PM +0200, Marc Marí wrote: > > > From: Gerd Hoffmann > > > > > > First draft of a fw_cfg dma interface. Designed as add-on to the > > > extisting fw_cfg interface, i.e. there is no select register. There > > > are four 32bit registers: Target address (low and high bits), > > > transfer length, control register. > > > > If I read this interface correctly, a guest will have at least six > > faults to complete a typical fw_cfg dma transfer (select, target low, > > target high, transfer length, control register write, control register > > read). I wonder if using a DMA transfer descriptor might be more > > efficient. [...] > That is probably faster and more flexible. I think it's a good step > forward. But, on the other side, is this a too big break of what is > actually implemented in MMIO? > > At the end we will have MMIO version, with a select and a data > register, and DMA version, with a 64 bit address register. How can we > differentiate between versions? Laszlo talks about the ID, but this is > already in one of the fields (so you need to know the protocol to get > the protocol). How could we do this transition more seamless? Well, one way would be to place a 64bit MMIO (or IO) register at a magic address. The firmware could then read the magic address and check it against a signature (eg, "QEMU CFG"). If the signature matches then it would know it could use the DMA version of the fw_cfg interface (by issuing writes, instead of reads, to the magic address). The firmware would then not have to use the older select/data fw_cfg interface at all. Another possibility would be to place the new fw_cfg dma register address into a named fw_cfg "file" (eg, "fw_cfg_dma"). The firmware could then use the existing select/data fw_cfg interface to check if the new dma interface is available by scanning for that "fw_cfg_dma" file. This has the advantage of not requiring a new "magic address", but has the disadvantage of a more complex probe. Just a thought, -Kevin