qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Glauber Costa <glommer@redhat.com>
To: Avi Kivity <avi@redhat.com>
Cc: Glauber Costa <glommer@gmail.com>,
	kvm-devel <kvm@vger.kernel.org>,
	qemu-devel@nongnu.org, Gerd Hoffmann <kraxel@redhat.com>
Subject: Re: [Qemu-devel] Re: [PATCH 3/3] Add KVM support to QEMU
Date: Wed, 29 Oct 2008 10:56:20 -0200	[thread overview]
Message-ID: <20081029125620.GH4269@poweredge.glommer> (raw)
In-Reply-To: <4908599D.8030502@redhat.com>

On Wed, Oct 29, 2008 at 02:39:57PM +0200, Avi Kivity wrote:
> Glauber Costa wrote:
>>>> Another place "hook" is updating a slot's dirty bitmap.  Right now, 
>>>>  with my patchset we don't have live migration or the VGA RAM   
>>>> optimization.  There's nothing about the VGA RAM optimization that  
>>>> wouldn't work for QEMU.  I'm not sure that it really is an   
>>>> optimization in the context of TCG, but I certainly don't think 
>>>> it's  any worse.  The only thing you really need is to query the 
>>>> KVM dirty  bitmap when it comes time to enable start over querying 
>>>> the VGA dirty  bits.
>>>>       
>>> I don't understand this.  The VGA optimization really is qemu's, the 
>>> kvm  modifications only cater to the different way of getting the 
>>> dirty bits.
>>>     
>>
>> As it seems to me, the real difference is that qemu has to explicitly set
>> certain regions as dirty, while kvm get dirty bit "automatically" from the kernel.
>>
>>   
>
> I'm completely lost.  I don't see how one or the other is more or less  
> automatic, or how qemu has to explicitly set regions as dirty (except  
> when emulating bitblt).
Or maybe I am. But I don't see any way in which qemu sets dirty bits but
explicitly with cpu_physical_memory_set_dirty(). This is pretty explicit.

>
>> So I believe we can have markers on the code to refresh dirty bitmap for certain
>> area ranges (for kvm use), and also enable a manual override (for qemu). After that,
>> the cpu_physical_memory_get_dirty() will simply return whether or not the page is
>> dirty.
>>   
>
> Does not cpu_p_m_g_dirty() simply return whether or not the page is  
> dirty now?

If you look at the vga code, you see something like:

    cpu_physical_memory_get_dirty(page0, VGA_DIRTY_FLAG) |
    cpu_physical_memory_get_dirty(page1, VGA_DIRTY_FLAG);
    if (kvm_enabled()) {
        update |= bitmap_get_dirty(bitmap, (page0 - s->vram_offset) >> TARGET_PAGE_BITS);
        update |= bitmap_get_dirty(bitmap, (page1 - s->vram_offset) >> TARGET_PAGE_BITS);
    }

so if the page is not dirty to cpu_p_m_g_dirty() (I liked that abb), it can still be dirty
for kvm. Ideally, it would not be necessary.

>
>> Also, kvm only tracks "dirty" bits, whereas qemu has at least three kinds of them.
>> But I think for now we can assume that kvm's dirty mean "all dirty
>
> kvm's dirty bits mean that kvm has seen the page written to since the  
> last query.  A zero doesn't mean the page is clean though -- it could  
> have been written to by qemu.

Right.
The point here is more like kvm has 1 type of dirty whereas qemu has many.

  reply	other threads:[~2008-10-29 12:54 UTC|newest]

Thread overview: 34+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-10-28 20:13 [Qemu-devel] [PATCH 1/3] Add additional CPU flag definitions Anthony Liguori
2008-10-28 20:13 ` [Qemu-devel] [PATCH 2/3] Split CPUID from op_helper Anthony Liguori
2008-10-28 20:13   ` [Qemu-devel] [PATCH 3/3] Add KVM support to QEMU Anthony Liguori
2008-10-28 20:49     ` Hollis Blanchard
2008-10-28 21:10       ` Anthony Liguori
2008-10-28 20:57     ` Andreas Färber
2008-10-28 21:04       ` Glauber Costa
2008-10-28 21:16         ` Anthony Liguori
2008-10-28 21:05       ` Anthony Liguori
2008-11-04 13:25         ` Avi Kivity
2008-10-28 21:41     ` [Qemu-devel] " Gerd Hoffmann
2008-10-28 21:51       ` Anthony Liguori
2008-10-28 23:04         ` Glauber Costa
2008-10-28 23:36           ` Anthony Liguori
2008-10-29  9:54             ` Avi Kivity
2008-10-29 12:35               ` Glauber Costa
2008-10-29 12:39                 ` Avi Kivity
2008-10-29 12:56                   ` Glauber Costa [this message]
2008-10-29 13:07               ` Anthony Liguori
2008-10-29 13:23                 ` Avi Kivity
2008-10-29 13:32                   ` Anthony Liguori
2008-10-29 13:51             ` Hollis Blanchard
2008-10-29 14:09               ` Avi Kivity
2008-10-29 14:16                 ` Fabrice Bellard
2008-10-29 14:23                   ` Anthony Liguori
2008-10-29 19:13                 ` Blue Swirl
2008-11-01 16:25                   ` Blue Swirl
2008-10-29 14:58     ` Glauber Costa
2008-10-29 17:41     ` Glauber Costa
2008-10-29 19:01       ` Anthony Liguori
2008-11-04 13:24     ` Avi Kivity
2008-11-04 14:02       ` Anthony Liguori
2008-11-04 14:46         ` Avi Kivity
2008-11-04 14:50           ` 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=20081029125620.GH4269@poweredge.glommer \
    --to=glommer@redhat.com \
    --cc=avi@redhat.com \
    --cc=glommer@gmail.com \
    --cc=kraxel@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;
as well as URLs for NNTP newsgroup(s).