xen-devel.lists.xenproject.org archive mirror
 help / color / mirror / Atom feed
From: "Yu, Zhang" <yu.c.zhang@linux.intel.com>
To: Jan Beulich <JBeulich@suse.com>, Paul Durrant <Paul.Durrant@citrix.com>
Cc: Kevin Tian <kevin.tian@intel.com>,
	"Keir (Xen.org)" <keir@xen.org>,
	Andrew Cooper <Andrew.Cooper3@citrix.com>,
	"Tim (Xen.org)" <tim@xen.org>,
	George Dunlap <George.Dunlap@citrix.com>,
	"xen-devel@lists.xen.org" <xen-devel@lists.xen.org>,
	"zhiyuan.lv@intel.com" <zhiyuan.lv@intel.com>,
	"jun.nakajima@intel.com" <jun.nakajima@intel.com>
Subject: Re: [PATCH 3/3] Add HVMOP to map guest ram with p2m_ioreq_server to an ioreq server
Date: Wed, 23 Mar 2016 17:44:39 +0800	[thread overview]
Message-ID: <56F26587.6010103@linux.intel.com> (raw)
In-Reply-To: <56F26E7202000078000DF8AF@prv-mh.provo.novell.com>

Thanks, Jan.

On 3/23/2016 5:22 PM, Jan Beulich wrote:
>>>> On 22.03.16 at 18:51, <Paul.Durrant@citrix.com> wrote:
>>> From: George Dunlap [mailto:george.dunlap@citrix.com]
>>> Sent: 22 March 2016 17:27
>>> There's not much documentation in the code about how this is expected to
>>> be used.
>>> For instance, having separate flags seems to imply that you can
>>> independently select either read intercept, write intercept, or both;
>>> but [ept_]p2m_type_to_flags() seems to assume that READ_ACCESS implies
>>> WRITE_ACCESS.  Do you plan to implement them separately in the future?
>>> If not, would it be better to make the interface an enum instead?
>>> At very least it should be documented that READ_ACCESS implies
>> That's not true. If WRITE_ACCESS has not been requested then writes are
>> handled directly in Xen rather than being forwarded to the ioreq server. If
>> h/w were to allow pages to be marked write-only then we wouldn't need to do
>> that.
> At least on EPT iirc you can have write-only pages, due to there
> being both an R and a W bit.

Sorry for not having clearly explained the flags parameter in this new
P2M_IOREQ_HANDLE_WRITE_ACCESS in flags only suggests that read/write
operations are supposed to be handled by one specific ioreq server,
which means this operation needs trap to the hypervisor, but not the
logic does not hold on the other way round, e.g. depriving the write
access right does not necessarily means write operation will be
forwarded to an ioreq server.

Besides, iiuc, setting the W bit to 1 with R bit cleared in EPT pte is
not really giving the write access right to the guest, and will trigger
ept misconfiguration.

>>>> +    p2m_memory_type_changed(d);
>>>> +
>>>> +    rc = 0;
>>>> +
>>>> +out:
> Btw: label placement.
> Jan
> _______________________________________________
> Xen-devel mailing list
> Xen-devel@lists.xen.org
> http://lists.xen.org/xen-devel


Xen-devel mailing list

  reply	other threads:[~2016-03-23  9:44 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-03-16 12:22 [PATCH 3/3] Add HVMOP to map guest ram with p2m_ioreq_server to an ioreq server Yu Zhang
2016-03-22 17:26 ` George Dunlap
2016-03-22 17:51   ` Paul Durrant
2016-03-23  9:22     ` Jan Beulich
2016-03-23  9:44       ` Yu, Zhang [this message]
2016-03-23 10:10         ` Jan Beulich
2016-03-23 10:37       ` Andrew Cooper
2016-03-23 11:43     ` George Dunlap

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:

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=56F26587.6010103@linux.intel.com \
    --to=yu.c.zhang@linux.intel.com \
    --cc=Andrew.Cooper3@citrix.com \
    --cc=George.Dunlap@citrix.com \
    --cc=JBeulich@suse.com \
    --cc=Paul.Durrant@citrix.com \
    --cc=jun.nakajima@intel.com \
    --cc=keir@xen.org \
    --cc=kevin.tian@intel.com \
    --cc=tim@xen.org \
    --cc=xen-devel@lists.xen.org \
    --cc=zhiyuan.lv@intel.com \


* 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).