qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Avi Kivity <avi@redhat.com>
To: Jordan Justen <jljusten@gmail.com>
Cc: Jordan Justen <jordan.l.justen@intel.com>,
	qemu-devel@nongnu.org, Alexander Graf <agraf@suse.de>
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	[thread overview]
Message-ID: <4EA669A5.9010009@redhat.com> (raw)
In-Reply-To: <CAFe8ug-OeFZj26A9kYt3bWLS16HcRtJpzvNRoMeq15mJ00mx4w@mail.gmail.com>

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.

  parent reply	other threads:[~2011-10-25  7:47 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-10-24 23:00 [Qemu-devel] Executing from a rom device - Re: [PATCH 2/4] pc: Support system flash memory with pflash Jordan Justen
2011-10-24 23:12 ` Alexander Graf
2011-10-25  7:48   ` Avi Kivity
2011-10-25  7:47 ` Avi Kivity [this message]
2011-10-25 21:06   ` Jordan Justen
2011-10-26 10:21     ` Avi Kivity

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4EA669A5.9010009@redhat.com \
    --to=avi@redhat.com \
    --cc=agraf@suse.de \
    --cc=jljusten@gmail.com \
    --cc=jordan.l.justen@intel.com \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).