xen-devel.lists.xenproject.org archive mirror
 help / color / mirror / Atom feed
From: Tim Deegan <tim@xen.org>
To: Jan Beulich <JBeulich@suse.com>
Cc: Kevin Tian <kevin.tian@intel.com>, Wei Liu <wei.liu2@citrix.com>,
	suravee.suthikulpanit@amd.com,
	Andrew Cooper <andrew.cooper3@citrix.com>,
	Eddie Dong <eddie.dong@intel.com>,
	Aravind Gopalakrishnan <aravind.gopalakrishnan@amd.com>,
	Jun Nakajima <jun.nakajima@intel.com>,
	xen-devel <xen-devel@lists.xenproject.org>,
	Boris Ostrovsky <boris.ostrovsky@oracle.com>,
	Keir Fraser <keir@xen.org>
Subject: Re: [PATCH] x86/HVM: honor p2m_ram_ro in hvm_map_guest_frame_rw()
Date: Tue, 11 Aug 2015 16:45:26 +0100	[thread overview]
Message-ID: <20150811154526.GC884@deinos.phlegethon.org> (raw)
In-Reply-To: <55CA32C90200007800099B76@prv-mh.provo.novell.com>

At 09:37 -0600 on 11 Aug (1439285833), Jan Beulich wrote:
> >>> On 11.08.15 at 16:34, <tim@xen.org> wrote:
> > At 07:51 -0600 on 11 Aug (1439279513), Jan Beulich wrote:
> >> >>> On 27.07.15 at 13:09, <tim@xen.org> wrote:
> >> > At 13:02 +0100 on 24 Jul (1437742964), Andrew Cooper wrote:
> >> >> On 24/07/15 10:41, Jan Beulich wrote:
> >> >> > Beyond that log-dirty handling in _hvm_map_guest_frame() looks bogus
> >> >> > too: What if a XEN_DOMCTL_SHADOW_OP_* gets issued and acted upon
> >> >> > between the setting of the dirty flag and the actual write happening?
> >> >> > I.e. shouldn't the flag instead be set in hvm_unmap_guest_frame()?
> >> >> 
> >> >> It does indeed.  (Ideally the dirty bit should probably be held high for 
> >> >> the duration that a mapping exists, but that is absolutely infeasible to 
> >> >> do).
> >> > 
> >> > IMO that would not be very useful -- a well-behaved toolstack will
> >> > have to make sure that relevant mappings are torn down before
> >> > stop-and-copy.  Forcing the dirty bit high in the meantime just makes
> >> > every intermediate pass send a wasted copy of the page, without
> >> > actually closing the race window if the tools are buggy.
> >> 
> >> Making sure such mappings got torn down in time doesn't help
> >> when the most recent write happened _after_ the most recent
> >> clearing of the dirty flag in a pass prior to stop-and-copy.
> > 
> > This is why e.g. __gnttab_unmap_common sets the dirty bit again
> > as it unmaps.
> 
> And how does this help when the mapping survives until the guest
> gets suspended?

Suspended is fine, so long as it happens before the final read of the
bitmap.

> And why would doing it _again_ when unmapping
> be better than doing it _only_ then?

My mistake - it is of course done _only_ then.

> But in any event I read this as agreement that moving (or in the
> worst case replicating) the hvm_map_guest_frame_rw() one into
> hvm_unmap_guest_frame() would be an appropriate thing to do.

Yep!

Tim.

  reply	other threads:[~2015-08-11 15:45 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-07-24  9:41 [PATCH] x86/HVM: honor p2m_ram_ro in hvm_map_guest_frame_rw() Jan Beulich
2015-07-24 10:26 ` Wei Liu
2015-07-24 10:37   ` Jan Beulich
2015-07-24 10:41     ` Wei Liu
2015-07-24 12:02 ` Andrew Cooper
2015-07-24 12:33   ` Jan Beulich
2015-07-27 11:09   ` Tim Deegan
2015-08-11 13:51     ` Jan Beulich
2015-08-11 14:34       ` Tim Deegan
2015-08-11 15:37         ` Jan Beulich
2015-08-11 15:45           ` Tim Deegan [this message]
2015-08-11 16:01             ` Jan Beulich
2015-07-31  1:41 ` Tian, Kevin
2015-07-31 16:06 ` Boris Ostrovsky
2015-08-11 10:32   ` Jan Beulich
2015-08-14 10:38   ` Jan Beulich
2015-08-14 13:26     ` Boris Ostrovsky

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=20150811154526.GC884@deinos.phlegethon.org \
    --to=tim@xen.org \
    --cc=JBeulich@suse.com \
    --cc=andrew.cooper3@citrix.com \
    --cc=aravind.gopalakrishnan@amd.com \
    --cc=boris.ostrovsky@oracle.com \
    --cc=eddie.dong@intel.com \
    --cc=jun.nakajima@intel.com \
    --cc=keir@xen.org \
    --cc=kevin.tian@intel.com \
    --cc=suravee.suthikulpanit@amd.com \
    --cc=wei.liu2@citrix.com \
    --cc=xen-devel@lists.xenproject.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).