qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Gleb Natapov <gleb@redhat.com>
To: Avi Kivity <avi@redhat.com>
Cc: Jordan Justen <jordan.l.justen@intel.com>,
	Jordan Justen <jljusten@gmail.com>,
	qemu-devel@nongnu.org, kvm-devel <kvm@vger.kernel.org>,
	Alexander Graf <agraf@suse.de>
Subject: Re: [Qemu-devel] KVM/QEMU: Support executing from flash device
Date: Sun, 4 Mar 2012 12:38:07 +0200	[thread overview]
Message-ID: <20120304103807.GO10743@redhat.com> (raw)
In-Reply-To: <4F5345A4.1090507@redhat.com>

On Sun, Mar 04, 2012 at 12:36:20PM +0200, Avi Kivity wrote:
> On 03/04/2012 10:12 AM, Gleb Natapov wrote:
> > On Sat, Mar 03, 2012 at 10:56:02PM -0800, Jordan Justen wrote:
> > > On Tue, Oct 25, 2011 at 00:47, Avi Kivity <avi@redhat.com> wrote:
> > > > 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).
> > > 
> > > Additional context for CC'd kvm-devel: I would like to support
> > > executing from an emulated flash memory on kvm.  The flash memory
> > > would be a CFI (Firmware Hub-like) device which is programmed via MMIO
> > > at the same addresses in memory where the execution would occur.
> > > 
> > > What is needed is:
> > > 1. The ability to set a region to allow read/exec,
> > >    but trap to qemu on writes.
> > > 2. qemu should then be able to set the region
> > >    to trap on reads/exec/writes.
> > Do you want to execute code from a flash while it traps on read/exec?
> > KVM emulator can't do that.
> 
> No, he wants read/exec to go to RAM, and writes to be handled as mmio. 
> This should work.
> 
That's mode 1 from above and will obviously work. I am asking about mode
2 from above.

--
			Gleb.

  reply	other threads:[~2012-03-04 10:38 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-03-04  6:56 [Qemu-devel] KVM/QEMU: Support executing from flash device Jordan Justen
2012-03-04  8:12 ` Gleb Natapov
2012-03-04 10:36   ` Avi Kivity
2012-03-04 10:38     ` Gleb Natapov [this message]
2012-03-04 10:46       ` Avi Kivity
2012-03-04 21:11         ` Jordan Justen
2012-03-04 10:44 ` 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=20120304103807.GO10743@redhat.com \
    --to=gleb@redhat.com \
    --cc=agraf@suse.de \
    --cc=avi@redhat.com \
    --cc=jljusten@gmail.com \
    --cc=jordan.l.justen@intel.com \
    --cc=kvm@vger.kernel.org \
    --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).