On 04/08/2013 04:43 PM, Gleb Natapov wrote: > On Mon, Apr 08, 2013 at 01:18:10AM -0700, Jordan Justen wrote: >> On Sun, Apr 7, 2013 at 11:06 PM, Xiao Guangrong >> <xiaoguangr...@linux.vnet.ibm.com> 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.
Yes. After delete the memslot, you can intercept both write and read. ;)