From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from [140.186.70.92] (port=56735 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PxcT4-0002rN-9h for qemu-devel@nongnu.org; Thu, 10 Mar 2011 04:47:39 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1PxcT2-0002bh-Vz for qemu-devel@nongnu.org; Thu, 10 Mar 2011 04:47:38 -0500 Received: from mx1.redhat.com ([209.132.183.28]:15992) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1PxcT2-0002bH-Mw for qemu-devel@nongnu.org; Thu, 10 Mar 2011 04:47:36 -0500 Date: Thu, 10 Mar 2011 11:47:26 +0200 From: Gleb Natapov Message-ID: <20110310094726.GB14805@redhat.com> References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Subject: [Qemu-devel] Re: RFC: emulation of system flash List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Jordan Justen Cc: Stefan Hajnoczi , Kevin O'Connor , qemu-devel , Michal Suchanek , Avi Kivity On Wed, Mar 09, 2011 at 08:51:23PM -0800, Jordan Justen wrote: > Hi all, > > I have documented a simple flash-like device which I think could be > useful for qemu/kvm in some cases. (Particularly for allowing > persistent UEFI non-volatile variables.) > > http://wiki.qemu.org/Features/System_Flash > > Let me know if you have any suggestions or concerns. > Two things. First You suggest to replace -bios with -flash. This will make firmware upgrade painful process that will have to be performed from inside the guest since the same flash image will contain both firmware and whatever data was stored on a flash which presumably you want to reuse after upgrading a firmware. My suggestion is to extend -bios option like this: -bios bios.bin,flash=flash.bin,flash_base=addr flash.bin will be mapped at address flash_base, or, if flash_base is not present, just below bios.bin. Second. I asked how flash is programmed because interfaces like CFI where you write into flash memory address range to issue commands cannot be emulated efficiently in KVM. KVM supports either regular memory slots or IO memory, but in your proposal the same memory behaves as IO on write and regular memory on read. Better idea would be to present non-volatile flash as ISA virtio device. Should be simple to implement. -- Gleb.