From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:33609) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UP7hA-0008A5-1K for qemu-devel@nongnu.org; Mon, 08 Apr 2013 04:45:01 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UP7h7-0003l7-B0 for qemu-devel@nongnu.org; Mon, 08 Apr 2013 04:44:55 -0400 Received: from mx1.redhat.com ([209.132.183.28]:14262) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UP7h7-0003kc-44 for qemu-devel@nongnu.org; Mon, 08 Apr 2013 04:44:53 -0400 Date: Mon, 8 Apr 2013 11:43:11 +0300 From: Gleb Natapov Message-ID: <20130408084311.GE17919@redhat.com> References: <1363717469-30980-1-git-send-email-peter.maydell@linaro.org> <87y5dh2o3j.fsf@blackfin.pond.sub.org> <51625E6C.5050105@linux.vnet.ibm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Subject: Re: [Qemu-devel] Use of flash for x86 BIOS List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Jordan Justen Cc: Peter Maydell , Anthony Liguori , Patch Tracking , "Justen, Jordan L" , Juan Quintela , qemu-devel , Xiao Guangrong , Markus Armbruster On Mon, Apr 08, 2013 at 01:18:10AM -0700, Jordan Justen wrote: > On Sun, Apr 7, 2013 at 11:06 PM, Xiao Guangrong > wrote: > > On 03/23/2013 03:09 AM, Jordan Justen wrote: > > > >> Admittedly, I've been completely ineffectual in resolving the kvm > >> portion. More recently I tried to make use of KVM_MEM_READONLY to > >> address this. I was able to get an VM exit on writes to flash, but not > >> able to get the memory region to convert to full device mode so VM > >> exits would occur on reads as well. I am once again stalled... > > > > Hi Jordan, > > > > What's memory region you want to get? I should admit that I do not > > have enough background of flash, could you please explain this > > requirement more detail? > > The flash memory requires two modes. > > Read/Execute mode: > * Initial state > * Writes will trap to QEMU, and may transition to Device mode based on > QEMU device emulation > > Device mode: > * Region is not executable > * All reads & writes will trap to QEMU > * May transition back to Read/Execute mode based on QEMU device emulation > > Using KVM_MEM_READONLY I was able to get Read/Execute mode to work, > but I was not able to get the memory region to transition to Device > mode. (I couldn't get reads to trap to QEMU.) > You need to drop memslot when you transition to Device mode. -- Gleb.