From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from [140.186.70.92] (port=54060 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PxnlX-00017N-9G for qemu-devel@nongnu.org; Thu, 10 Mar 2011 16:51:28 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1PxnlV-0001O2-Gz for qemu-devel@nongnu.org; Thu, 10 Mar 2011 16:51:27 -0500 Received: from mailout-de.gmx.net ([213.165.64.22]:60923) by eggs.gnu.org with smtp (Exim 4.71) (envelope-from ) id 1PxnlV-0001Nj-4z for qemu-devel@nongnu.org; Thu, 10 Mar 2011 16:51:25 -0500 Message-ID: <4D794819.1060001@gmx.net> Date: Thu, 10 Mar 2011 22:52:25 +0100 From: Carl-Daniel Hailfinger MIME-Version: 1.0 Subject: Re: [Qemu-devel] Re: RFC: emulation of system flash References: <4D789588.1060108@redhat.com> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Jordan Justen Cc: Gleb Natapov , Stefan Hajnoczi , qemu-devel , Michal Suchanek , Kevin O'Connor , Avi Kivity Auf 10.03.2011 19:43, Jordan Justen schrieb: > On Thu, Mar 10, 2011 at 01:10, Avi Kivity wrote: > >> On 03/10/2011 06:51 AM, Jordan Justen wrote: >> >>> http://wiki.qemu.org/Features/System_Flash >>> >>> >> - make the programming interface the same as an existing device >> > How strongly do you feel about this? > > For one thing, real devices are not as flexible as QEMU for flash > sizes. QEMU allows for any 64kb multiple bios size. Real world > devices generally only support powers of 2 sizes. > > Firmware hub devices are somewhat simplistic to emulate, but I think > they use 16MB of address space, while only providing <= 1MB of flash > storage. > Up to 4 MB on real hardware, and if you use Parallel flash devices, there is no limit at all (except cost). The software interface is identical for read/write/erase/probe. > SPI devices are available in many sizes, so it might be possible to > choose a 16MB device to emulate. But, it would be a lot more complex > to emulate as it would it involve emulating an SPI contoller + the > device. > I have written a SPI flash chip emulator (it emulates 3 different real-world SPI flash chips) and am willing to contribute it to Qemu if there is interest. The code is pretty small, and adding a SPI host controller emulator should be a few lines of code extra. Not a big problem. > I thought this might be a case where deviation from real hardware > emulation could better serve the VM's needs. > If we have to write the code anyway, and if it can work just fine with current KVM/Qemu, is there a reason not to use the same interface as real hardware? Regards, Carl-Daniel -- http://www.hailfinger.org/