qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] Executing from a rom device - Re: [PATCH 2/4] pc: Suppo


From: Avi Kivity
Subject: Re: [Qemu-devel] Executing from a rom device - Re: [PATCH 2/4] pc: Support system flash memory with pflash
Date: Tue, 25 Oct 2011 09:47:49 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:7.0.1) Gecko/20110930 Thunderbird/7.0.1

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.




reply via email to

[Prev in Thread] Current Thread [Next in Thread]