xen-devel.lists.xenproject.org archive mirror
 help / color / mirror / Atom feed
From: Paul Durrant <Paul.Durrant@citrix.com>
To: Kevin Tian <kevin.tian@intel.com>, Jan Beulich <JBeulich@suse.com>
Cc: Wei Liu <wei.liu2@citrix.com>,
	Ian Campbell <Ian.Campbell@citrix.com>,
	Andrew Cooper <Andrew.Cooper3@citrix.com>,
	George Dunlap <dunlapg@umich.edu>,
	Zhang Yu <yu.c.zhang@linux.intel.com>,
	George Dunlap <George.Dunlap@citrix.com>,
	"xen-devel@lists.xen.org" <xen-devel@lists.xen.org>,
	Stefano Stabellini <Stefano.Stabellini@citrix.com>,
	"Lv, Zhiyuan" <zhiyuan.lv@intel.com>,
	Ian Jackson <Ian.Jackson@citrix.com>,
	"Keir (Xen.org)" <keir@xen.org>
Subject: Re: [PATCH v3 3/3] tools: introduce parameter max_wp_ram_ranges.
Date: Wed, 17 Feb 2016 08:58:29 +0000	[thread overview]
Message-ID: <18f9277a243247739d1565f71accca8f@AMSPEX02CL03.citrite.net> (raw)
In-Reply-To: <AADFC41AFE54684AB9EE6CBC0274A5D15F7B5172@SHSMSX101.ccr.corp.intel.com>

> -----Original Message-----
[snip]
> > > >
> > > > I'm afraid I have made little progress due to the distractions of trying
> get
> > > > some patches into Linux but my thoughts are around replacing the
> > > > HVM_mmio_write_dm with something like HVM_emulate_0 (i.e. the
> zero-
> > > th example
> > > > of a type that requires emulation, to be followed by others in future)
> and
> > > > then add a hypercall along the lines of
> > > HVMOP_map_mem_type_to_ioreq_server
> > > > which will take an ioerq server id, a type and flags saying whether it
> wishes
> > > > to handle reads and/or writes to that type.
> > > >
> > > > Thoughts (anyone)?
> > >
> > > I think as a general idea also allowing reads to be intercepted is
> > > nice, but would incur quite a few changes which we don't currently
> > > have a user for. Hence I'd suggest making the public interface
> > > ready for that without actually implementing hypervisor support.
> > >
> >
> > Well, we need some form a hypervisor support to replace what's already
> there.
> >
> > I'd envisaged that setting HVM_emulate_0 type on a page would mean
> nothing until an
> 
> for "mean nothing" what is the default policy then if guest happens to access
> it
> before any ioreq server claims it?
> 

My thoughts were that, since no specific emulation has yet been requested (because no ioreq server has yet claimed it) that the default policy is to treat it as r/w RAM as I said below. This is because I think the only legal type transitions should be from HVMMEM_ram_rw to HVMMEM_emulate_0 and back again.

> > ioreq server claims it (i.e. it stays as r/w RAM) but when the ioreq server
> makes the claim
> > the EPT is changed according to whether reads and/or writes are wanted
> and then the fault
> > handler steers transactions to the (single at the moment) ioreq server. I'll
> need to code up
> > a PoC to make sure I'm not barking up the wrong tree though.
> >
> 
> Curious any reason why we must have a HVM_emulate_0 placeholder
> first and why we can't allow ioreq server to claim on any existing type?

Which type were you thinking of? Remember that the ioreq server would be claiming *all* pages of that type.

> Thinking about XenGT usage, I cannot envisage when a page should
> be set to HVM_emulate_0 first. The write-protection operation is dynamic
> according to guest page table operations, upon which we'll directly jump
> to claim phase...

I don't imagine that things would happen that way round in the common case. For XenGT I'd expect the ioreq server to immediately claim HVMMEM_emulate_0 and then set that type on any page that it wants to trap accesses on (which means that
I am assuming that the same emulation - i.e. write accesses only - is desired for all pages... but I think that is indeed the case).

> 
> btw does this design consider the case where multiple ioreq servers
> may claim on same page?

Yes it does and there are currently insufficient page types to allow any more than a single ioreq server to claim a type. My plan is that, in future, we can add a p2t mapping table to allow for more types and then introduce HVMMEM_ioreq_1, HVMMEM_ioreq_2, etc.

> For example, different usages may both
> want to capture write requests on the same set of pages (say XenGT
> selectively write-protects a subset of pages due to shadow GTT, while
> another agent wants to monitor all guest writes to any guest memory
> page).

Monitoring is a different thing altogether. Emulation is costly and not something you'd want to use for that purpose. If you want to monitor writes then log-dirty already exists for that purpose.

> 
> Thanks
> Kevin

I hope my explanation helped. I think things will be clearer once I've had chance to actually put together a design doc. and hack up a PoC (probably only for EPT at first).

  Paul

  reply	other threads:[~2016-02-17  8:58 UTC|newest]

Thread overview: 109+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-01-29 10:45 [PATCH v12 0/3] Refactor ioreq server for better performance Yu Zhang
2016-01-29 10:45 ` [PATCH v12 1/3] Refactor rangeset structure " Yu Zhang
2016-01-29 10:45 ` [PATCH v12 2/3] Differentiate IO/mem resources tracked by ioreq server Yu Zhang
2016-01-29 10:45 ` [PATCH v3 3/3] tools: introduce parameter max_wp_ram_ranges Yu Zhang
2016-01-29 16:33   ` Jan Beulich
2016-01-30 14:38     ` Yu, Zhang
2016-02-01  7:52       ` Jan Beulich
2016-02-01 12:02         ` Wei Liu
2016-02-01 12:15           ` Jan Beulich
2016-02-01 12:49             ` Wei Liu
2016-02-01 13:07               ` Jan Beulich
2016-02-01 15:14                 ` Yu, Zhang
2016-02-01 16:16                   ` Jan Beulich
2016-02-01 16:33                     ` Yu, Zhang
2016-02-01 16:19                   ` Yu, Zhang
2016-02-01 16:35                     ` Jan Beulich
2016-02-01 16:37                       ` Yu, Zhang
2016-02-01 17:05                         ` Ian Jackson
2016-02-02  8:04                           ` Yu, Zhang
2016-02-02 11:51                             ` Wei Liu
2016-02-02 13:56                               ` Yu, Zhang
2016-02-02 10:32                           ` Jan Beulich
2016-02-02 10:56                             ` Yu, Zhang
2016-02-02 11:12                               ` Jan Beulich
2016-02-02 14:01                                 ` Yu, Zhang
2016-02-02 14:42                                   ` Jan Beulich
2016-02-02 15:00                                     ` Yu, Zhang
2016-02-02 15:21                                       ` Jan Beulich
2016-02-02 15:19                                         ` Yu, Zhang
2016-02-03  7:10                                         ` Yu, Zhang
2016-02-03  8:32                                           ` Jan Beulich
2016-02-03 12:20                                             ` Paul Durrant
2016-02-03 12:35                                               ` Jan Beulich
2016-02-03 12:50                                                 ` Paul Durrant
2016-02-03 13:00                                                   ` Jan Beulich
2016-02-03 13:07                                                     ` Paul Durrant
2016-02-03 13:17                                                       ` Jan Beulich
2016-02-03 13:18                                                         ` Paul Durrant
2016-02-03 14:43                                                           ` Ian Jackson
2016-02-03 15:10                                                             ` Paul Durrant
2016-02-03 17:50                                                               ` George Dunlap
2016-02-04  8:50                                                                 ` Yu, Zhang
2016-02-03 17:41                                                             ` George Dunlap
2016-02-03 18:21                                                               ` George Dunlap
2016-02-03 18:26                                                                 ` George Dunlap
2016-02-03 18:39                                                                 ` Andrew Cooper
2016-02-03 19:12                                                                   ` George Dunlap
2016-02-04  8:51                                                                     ` Yu, Zhang
2016-02-04 10:49                                                                       ` George Dunlap
2016-02-04 11:08                                                                         ` Ian Campbell
2016-02-04 11:19                                                                           ` Ian Campbell
2016-02-04  8:50                                                                 ` Yu, Zhang
2016-02-04  9:28                                                                   ` Paul Durrant
2016-02-04  9:38                                                                     ` Yu, Zhang
2016-02-04  9:49                                                                       ` Paul Durrant
2016-02-04 10:34                                                                       ` Jan Beulich
2016-02-04 13:33                                                                         ` Ian Jackson
2016-02-04 13:47                                                                           ` Paul Durrant
2016-02-04 14:12                                                                             ` Jan Beulich
2016-02-04 14:25                                                                               ` Paul Durrant
2016-02-04 15:06                                                                                 ` Ian Jackson
2016-02-04 15:51                                                                                   ` Paul Durrant
2016-02-05  3:47                                                                                     ` Tian, Kevin
2016-02-05  3:35                                                                               ` Tian, Kevin
2016-02-04 14:08                                                                           ` Jan Beulich
2016-02-04 17:12                                                                             ` George Dunlap
2016-02-05  4:18                                                                               ` Tian, Kevin
2016-02-05  8:41                                                                                 ` Yu, Zhang
2016-02-05  8:32                                                                               ` Jan Beulich
2016-02-05  9:24                                                                                 ` Paul Durrant
2016-02-05 10:41                                                                                   ` Jan Beulich
2016-02-05 11:14                                                                                   ` George Dunlap
2016-02-05 11:24                                                                                     ` Paul Durrant
2016-02-16  7:22                                                                                       ` Tian, Kevin
2016-02-16  8:50                                                                                         ` Paul Durrant
2016-02-16 10:33                                                                                           ` Jan Beulich
2016-02-16 11:11                                                                                             ` Paul Durrant
2016-02-17  3:18                                                                                               ` Tian, Kevin
2016-02-17  8:58                                                                                                 ` Paul Durrant [this message]
2016-02-17  9:32                                                                                                   ` Jan Beulich
2016-02-17  9:58                                                                                                   ` Tian, Kevin
2016-02-17 10:03                                                                                                     ` Paul Durrant
2016-02-17 10:22                                                                                                     ` Jan Beulich
2016-02-17 10:24                                                                                                       ` Paul Durrant
2016-02-17 10:25                                                                                                         ` Tian, Kevin
2016-02-17 11:01                                                                                                       ` George Dunlap
2016-02-17 11:12                                                                                                         ` Paul Durrant
2016-02-22 15:56                                                                                                           ` George Dunlap
2016-02-22 16:02                                                                                                             ` Paul Durrant
2016-02-22 16:45                                                                                                               ` George Dunlap
2016-02-22 17:01                                                                                                                 ` Paul Durrant
2016-02-22 17:23                                                                                                                   ` George Dunlap
2016-02-22 17:34                                                                                                                     ` Paul Durrant
2016-02-05  8:41                                                                               ` Yu, Zhang
2016-02-04 11:06                                                                       ` George Dunlap
2016-02-05  2:01                                                                         ` Zhiyuan Lv
2016-02-05  3:44                                                                           ` Tian, Kevin
2016-02-05  8:38                                                                             ` Jan Beulich
2016-02-05 11:05                                                                             ` George Dunlap
2016-02-05 15:13                                                                               ` Zhiyuan Lv
2016-02-05 20:14                                                                                 ` George Dunlap
2016-02-05  8:40                                                                         ` Yu, Zhang
2016-02-04 10:06                                                               ` Ian Campbell
2016-02-05  3:31                                                                 ` Tian, Kevin
2016-02-02 11:31                             ` Andrew Cooper
2016-02-02 11:43                               ` Jan Beulich
2016-02-02 14:20                                 ` Andrew Cooper
2016-02-01 11:57   ` Wei Liu
2016-02-01 15:15     ` Yu, Zhang

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=18f9277a243247739d1565f71accca8f@AMSPEX02CL03.citrite.net \
    --to=paul.durrant@citrix.com \
    --cc=Andrew.Cooper3@citrix.com \
    --cc=George.Dunlap@citrix.com \
    --cc=Ian.Campbell@citrix.com \
    --cc=Ian.Jackson@citrix.com \
    --cc=JBeulich@suse.com \
    --cc=Stefano.Stabellini@citrix.com \
    --cc=dunlapg@umich.edu \
    --cc=keir@xen.org \
    --cc=kevin.tian@intel.com \
    --cc=wei.liu2@citrix.com \
    --cc=xen-devel@lists.xen.org \
    --cc=yu.c.zhang@linux.intel.com \
    --cc=zhiyuan.lv@intel.com \
    /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).