From: "Jan Beulich" <JBeulich@suse.com>
To: Wei Ye <wei.ye@intel.com>
Cc: Kevin Tian <kevin.tian@intel.com>, "keir@xen.org" <keir@xen.org>,
"ian.campbell@citrix.com" <ian.campbell@citrix.com>,
"stefano.stabellini@eu.citrix.com"
<stefano.stabellini@eu.citrix.com>, "tim@xen.org" <tim@xen.org>,
"ian.jackson@eu.citrix.com" <ian.jackson@eu.citrix.com>,
Donald D Dugger <donald.d.dugger@intel.com>,
"xen-devel@lists.xen.org" <xen-devel@lists.xen.org>,
"Paul.Durrant@citrix.com" <Paul.Durrant@citrix.com>,
Zhiyuan Lv <zhiyuan.lv@intel.com>,
Yang Z Zhang <yang.z.zhang@intel.com>
Subject: Re: [PATCH v3 2/2] ioreq-server: write protected range and forwarding
Date: Wed, 10 Sep 2014 10:19:09 +0100 [thread overview]
Message-ID: <541033AD020000780003319A@mail.emea.novell.com> (raw)
In-Reply-To: <76A3A946BA26DE4F9D9D5090FFA4A649342CBA@SHSMSX101.ccr.corp.intel.com>
>>> On 10.09.14 at 07:32, <wei.ye@intel.com> wrote:
>
>> -----Original Message-----
>> From: xen-devel-bounces@lists.xen.org [mailto:xen-devel-
>> bounces@lists.xen.org] On Behalf Of Jan Beulich
>> Sent: Wednesday, September 3, 2014 9:17 PM
>> To: Ye, Wei
>> Cc: Tian, Kevin; keir@xen.org; ian.campbell@citrix.com;
>> stefano.stabellini@eu.citrix.com; tim@xen.org; ian.jackson@eu.citrix.com;
>> Dugger, Donald D; xen-devel@lists.xen.org; Paul.Durrant@citrix.com; Lv,
>> Zhiyuan; Zhang, Yang Z
>> Subject: Re: [Xen-devel] [PATCH v3 2/2] ioreq-server: write protected range
>> and forwarding
>>
>> >>> On 03.09.14 at 23:53, <wei.ye@intel.com> wrote:
>> > +static int hvm_change_p2m_type_ioreq_server(struct domain *d,
>> uint16_t set,
>> > + uint64_t start, uint64_t
>> > +end) {
>> > + int rc = -EINVAL;
>> > + uint64_t gpfn_s, gpfn_e, gpfn;
>> > + p2m_type_t ot, nt;
>> > +
>> > + if ( set )
>> > + {
>> > + ot = p2m_ram_rw;
>> > + nt = p2m_mmio_write_dm;
>> > + }
>> > + else
>> > + {
>> > + ot = p2m_mmio_write_dm;
>> > + nt = p2m_ram_rw;
>> > + }
>> > +
>> > + gpfn_s = start >> PAGE_SHIFT;
>> > + gpfn_e = end >> PAGE_SHIFT;
>>
>> Considering that the first really ought to be PFN_DOWN() - is the latter
> really
>> correct? I'd rather expect that to be PFN_UP()...
>>
> I think the latter one is also should be PFN_DOWN. Considering a range is
> [0x0000, 0x1000],
> then only the first pfn 0 should be changed. Note that the follow loop:
> for (gpfn = gpfn_s; gpfn <= gpfn_e; gpfn++)
> The gpfn_e is included. If PFN_UP is to calculate the gpfn_e, there's wrong
> p2m type change
> to pfn 1.
But then (i.e. if the range is inclusive) it still needs to be
PFN_UP(end - 1).
Jan
next prev parent reply other threads:[~2014-09-10 9:19 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-09-03 21:53 [PATCH v3 0/2] Extend ioreq-server to support page write protection Wei Ye
2014-09-03 21:53 ` [PATCH v3 1/2] x86: add p2m_mmio_write_dm Wei Ye
2014-09-03 9:54 ` Paul Durrant
2014-09-03 10:03 ` Jan Beulich
2014-09-03 21:53 ` [PATCH v3 2/2] ioreq-server: write protected range and forwarding Wei Ye
2014-09-03 10:11 ` Paul Durrant
2014-09-04 23:10 ` Tian, Kevin
2014-09-05 0:44 ` Ye, Wei
2014-09-05 9:01 ` Paul Durrant
2014-09-10 6:10 ` Ye, Wei
2014-09-10 21:02 ` Tian, Kevin
2014-09-11 14:38 ` Paul Durrant
2014-09-16 21:25 ` Tian, Kevin
2014-09-11 14:45 ` Paul Durrant
2014-09-03 13:17 ` Jan Beulich
2014-09-04 0:31 ` Ye, Wei
2014-09-10 5:32 ` Ye, Wei
2014-09-10 9:19 ` Jan Beulich [this message]
2014-09-10 9:30 ` Jan Beulich
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=541033AD020000780003319A@mail.emea.novell.com \
--to=jbeulich@suse.com \
--cc=Paul.Durrant@citrix.com \
--cc=donald.d.dugger@intel.com \
--cc=ian.campbell@citrix.com \
--cc=ian.jackson@eu.citrix.com \
--cc=keir@xen.org \
--cc=kevin.tian@intel.com \
--cc=stefano.stabellini@eu.citrix.com \
--cc=tim@xen.org \
--cc=wei.ye@intel.com \
--cc=xen-devel@lists.xen.org \
--cc=yang.z.zhang@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).