public inbox for kvm@vger.kernel.org
 help / color / mirror / Atom feed
From: Anthony Liguori <anthony@codemonkey.ws>
To: Alexander Graf <agraf@suse.de>
Cc: Avi Kivity <avi@redhat.com>,
	"kvm@vger.kernel.org" <kvm@vger.kernel.org>,
	"qemu-devel@nongnu.org" <qemu-devel@nongnu.org>
Subject: Re: [Qemu-devel] [PATCH 2/3] memory: add API for creating ROM/device regions
Date: Sun, 14 Aug 2011 08:51:06 -0500	[thread overview]
Message-ID: <4E47D2CA.1090902@codemonkey.ws> (raw)
In-Reply-To: <4936D0E3-551F-4779-B1A0-43D872277876@suse.de>

On 08/14/2011 10:43 AM, Alexander Graf wrote:
>
> Am 14.08.2011 um 06:29 schrieb Anthony Liguori<anthony@codemonkey.ws>:
>
>> On 08/13/2011 10:05 PM, Avi Kivity wrote:
>>> On 08/12/2011 06:48 AM, Anthony Liguori wrote:
>>>>> target_phys_addr_t offset_in_region;
>>>>> AddrRange addr;
>>>>> uint8_t dirty_log_mask;
>>>>> + bool readable;
>>>> @@ -125,6 +125,7 @@ struct FlatRange {
>>>>
>>>> In a follow up, it might be good to add a comment explaining that this
>>>> whole readable thing is not just an optimization, but a hard
>>>> requirement for KVM in order to be able to execute code from ROM.
>>>
>>> This has nothing to do with kvm (in fact, I think we cannot support it
>>> under kvm with current interfaces). It's there to support devices that
>>> sometimes act as RAM and sometimes as mmio.
>>
>> That is not a functional behavior but rather an optimization. Functionally speaking, there is absolutely no different between "acting as RAM" and "acting as mmio".
>>
>> But you cannot remove the optimization because of the aforementioned limitation in KVM.
>>
>> Maybe it's just me but I find this to be a very subtle detail so a comment would be helpful :-)
>
> Well, TCG also can't execute from MMIO, right?

Yes, it can.  To be fully correct, you basically have to.  During BIOS 
initialization, the BIOS uses PAM to move itself from ROM to RAM to 
speed up BIOS execution.  During this time period, memory reads come 
from one location (ROM) but writes go to another location (RAM).

Since we can't do this in KVM, SeaBIOS carries a hack to just skip this 
step if it detects its runnning on KVM.

> So it's at least not KVM specific - TCG also gets the speedup from mapping roms as ram.

Don't get me wrong, the optimization is important.  I'm just suggesting 
to document it since as can be demonstrated by this conversation, it's a 
subtle detail :-)

Regards,

Anthony Liguori

>
> Alex
>
>>
>


  reply	other threads:[~2011-08-14 15:51 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-08-08 16:58 [PATCH 0/3] Memory API updates Avi Kivity
2011-08-08 16:58 ` [PATCH 1/3] memory: reclaim resources when a memory region is destroyed for good Avi Kivity
2011-08-08 16:58 ` [PATCH 2/3] memory: add API for creating ROM/device regions Avi Kivity
2011-08-12 13:48   ` [Qemu-devel] " Anthony Liguori
2011-08-14  3:05     ` Avi Kivity
2011-08-14 13:29       ` Anthony Liguori
2011-08-14 15:43         ` Alexander Graf
2011-08-14 13:51           ` Anthony Liguori [this message]
2011-08-08 16:58 ` [PATCH 3/3] memory: correct documentation typos Avi Kivity
2011-08-12 13:47 ` [PATCH 0/3] Memory API updates Anthony Liguori

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=4E47D2CA.1090902@codemonkey.ws \
    --to=anthony@codemonkey.ws \
    --cc=agraf@suse.de \
    --cc=avi@redhat.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