qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Jan Kiszka <jan.kiszka@web.de>
To: Jamie Lokier <jamie@shareable.org>
Cc: Michael Walle <michael@walle.cc>, qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] [PATCH 2/4] Add support for execution from ROMs in IO device mode
Date: Thu, 13 May 2010 22:24:03 +0200	[thread overview]
Message-ID: <4BEC5FE3.6080806@web.de> (raw)
In-Reply-To: <4BEC5CC7.4010200@web.de>

[-- Attachment #1: Type: text/plain, Size: 1480 bytes --]

Jan Kiszka wrote:
> Jamie Lokier wrote:
>> Jan Kiszka wrote:
>>> While IO_MEM_ROMD marks an I/O memory region as "read/execute from RAM,
>>> but write to I/O handler", there is no flag indicating that an I/O
>>> region which is fully managed by I/O handlers can still be hosting
>>> executable code. One use case for this are flash device models that
>>> switch to I/O mode during reprogramming. Not all reprogramming states
>>> modify to read data, thus practically allow to continue execution.
>>> Moreover, we need to avoid switching the modes too frequently for
>>> performance reasons which requires fetching opcodes while still in I/O
>>> device mode.
>> I like this change.
>>
>> Does "fetching opcodes while still in I/O device mode" fetch opcodes
>> from the RAM backing, or via the I/O read handlers?
> 
> Via the latter. This is most "correct" in that broken guests that jump
> to the ROM while it's in some critical write cycle will properly crash.
> 
>> If the latter, I'm wondering how KVM would cope with that.
> 
> I think it won't work without extending KVM to fetch - as a last resort
> - also from I/O devices. Or we give up the "correctness" and keep the
> RAM-base KVM slot for IO_MEM_EXEC regions. That should be solvable in a
> transparent way in kvm_set_phys_mem.

Which, of course, would break CFI reads etc. for KVM guest. So this
feature actually requires additional support by KVM to fetch code from
I/O devices.

Jan


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 257 bytes --]

  reply	other threads:[~2010-05-13 20:24 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-05-13 14:16 [Qemu-devel] [PATCH 0/4] Fix the lazy CFI mode switch Jan Kiszka
2010-05-13 14:16 ` [Qemu-devel] [PATCH 1/4] cfi02: Fix a debug print Jan Kiszka
2010-05-13 14:16 ` [Qemu-devel] [PATCH 2/4] Add support for execution from ROMs in IO device mode Jan Kiszka
2010-05-13 19:23   ` Jamie Lokier
2010-05-13 20:10     ` Jan Kiszka
2010-05-13 20:24       ` Jan Kiszka [this message]
2010-05-13 14:16 ` [Qemu-devel] [PATCH 3/4] cfi: Mark flash memory executable Jan Kiszka
2010-05-13 14:16 ` [Qemu-devel] [PATCH 4/4] cfi02: Use timer-based ROM mode switch Jan Kiszka

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=4BEC5FE3.6080806@web.de \
    --to=jan.kiszka@web.de \
    --cc=jamie@shareable.org \
    --cc=michael@walle.cc \
    --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).