Avi, all, Would it be acceptable to implement the pflash support for qemu only at this time? If kvm is enabled, I could install ram (in read-only mode) as is done today for the firmware to execute from.
Later, when the additional kvm feature you described below is implemented, then I can update the qemu kvm path to enable this support. (I will also attempt to implement the kvm kernel+qemu pieces of this.) Thanks, -Jordan On Tue, Oct 25, 2011 at 00:47, Avi Kivity <a...@redhat.com> wrote: > On 10/25/2011 01:00 AM, Jordan Justen wrote: >> Avi, >> >> Alex pointed out that my patch below should not work for kvm, because >> kvm currently does not support executing from a rom region. This >> surprised me, because I thought I had been testing with kvm enabled. >> But, it turns out I wasn't, and in fact this patch does not work with >> kvm enabled. (Sorry all for this big mistake in my testing.) >> >> Alex also suggested that you might be able to answer whether it would >> be possible to execute from a flash device (ie, qemu 'rom_device' >> device). Is this something that would be possible with kvm? >> >> If so, would it require changes to kvm on the kernel side? Or, the >> qemu side? Perhaps just within the pflash_cfi01 device? >> >> Would implementing it require the flash based execution to be very >> slow under kvm? > > The core issue that kvm (the kernel part) supports two styles of memory: > read/write RAM, and read/write MMIO. ROM wants writes to be ignored, > and rom/device wants reads serviced from memory and writes serviced by > userspace (as MMIO). > > It should not be too hard to patch kvm to support these additional two > styles. The entry point is the KVM_SET_USER_MEMORY_REGION ioctl to > define the new attributes for the region, and kvm_mmu_page_fault() to > map these pages as read-only and emulate writes (for ROM/device regions). > > -- > I have a truly marvellous patch that fixes the bug which this > signature is too narrow to contain. > >