qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Paolo Bonzini <pbonzini@redhat.com>
To: Hollis Blanchard <hollis_blanchard@mentor.com>
Cc: qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] io_mem_notdirty and live migration
Date: Thu, 24 Mar 2016 18:01:48 -0400 (EDT)	[thread overview]
Message-ID: <1922103888.40590155.1458856908309.JavaMail.zimbra@redhat.com> (raw)
In-Reply-To: <56F44039.4000302@mentor.com>



----- Original Message -----
> From: "Hollis Blanchard" <hollis_blanchard@mentor.com>
> To: "Paolo Bonzini" <pbonzini@redhat.com>
> Cc: qemu-devel@nongnu.org
> Sent: Thursday, March 24, 2016 8:30:01 PM
> Subject: Re: io_mem_notdirty and live migration
> 
> On 03/23/2016 09:53 AM, Paolo Bonzini wrote:
> > On 23/03/2016 17:47, Hollis Blanchard wrote:
> >> Paolo, is it true that only TB-invalidating writes go through the
> >> io_mem_notdirty path? I'm looking at the live migration code now, and it
> >> seems like every memory write will go through that path when global
> >> dirty memory logging is enabled.
> > When live migration is enabled, writes to clean memory (almost all of
> > them) will go through that path indeed.  Some writes to the framebuffer
> > will go through that path too.
> >
> > It depends on
> >
> >        cpu_physical_memory_is_clean(
> >                          memory_region_get_ram_addr(section->mr) + xlat))
> >
> > in tlb_set_page_with_attrs.
> 
> I'm guessing that when live migration starts (ram_save_setup), the TLB
> must be flushed so that new entries can be created with the TLB_NOTDIRTY
> flag. Otherwise, pre-migration entries without TLB_NOTDIRTY flag could
> live on, allowing the TBs to directly modify guest RAM without tracking,
> right?
> 
> I can't find anything underneath ram_save_setup() that does this,
> though. Am I just missing it?

It's done (in a pretty roundabout way) by tcg_commit, which is called
by memory_global_dirty_log_start's call to memory_region_transaction_commit.

Paolo

  reply	other threads:[~2016-03-24 22:01 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-02-17 21:29 [Qemu-devel] [PATCH 1/2] trace: include CPU index in trace_memory_region_ops_*() Hollis Blanchard
2016-02-17 21:29 ` [Qemu-devel] [PATCH 2/2] trace: separate MMIO tracepoints from TB-access tracepoints Hollis Blanchard
2016-02-18 18:37   ` Hollis Blanchard
2016-02-24 14:13   ` Stefan Hajnoczi
2016-03-23 16:47   ` Hollis Blanchard
2016-03-23 16:53     ` Paolo Bonzini
2016-03-23 17:16       ` Hollis Blanchard
2016-03-24 19:30       ` [Qemu-devel] io_mem_notdirty and live migration Hollis Blanchard
2016-03-24 22:01         ` Paolo Bonzini [this message]
2016-02-24 14:12 ` [Qemu-devel] [PATCH 1/2] trace: include CPU index in trace_memory_region_ops_*() Stefan Hajnoczi

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=1922103888.40590155.1458856908309.JavaMail.zimbra@redhat.com \
    --to=pbonzini@redhat.com \
    --cc=hollis_blanchard@mentor.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).