All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Yu, Zhang" <yu.c.zhang@linux.intel.com>
To: Tim Deegan <tim@xen.org>
Cc: kevin.tian@intel.com, keir@xen.org, ian.campbell@citrix.com,
	stefano.stabellini@eu.citrix.com, ian.jackson@eu.citrix.com,
	donald.d.dugger@intel.com, Xen-devel@lists.xen.org,
	Paul.Durrant@citrix.com, zhiyuan.lv@intel.com, JBeulich@suse.com,
	yang.z.zhang@intel.com
Subject: Re: [PATCH v5 2/2] add a new p2m type - p2m_mmio_write_dm
Date: Fri, 05 Dec 2014 10:00:44 +0800	[thread overview]
Message-ID: <548111CC.1070300@linux.intel.com> (raw)
In-Reply-To: <20141204160445.GD43116@deinos.phlegethon.org>



On 12/5/2014 12:04 AM, Tim Deegan wrote:
> Hi,
>
> At 21:13 +0800 on 04 Dec (1417724006), Yu Zhang wrote:
>> A new p2m type, p2m_mmio_write_dm, is added to trap and emulate
>> the write operations on GPU's page tables. Handling of this new
>> p2m type are similar with existing p2m_ram_ro in most condition
>> checks, with only difference on final policy of emulation vs. drop.
>> For p2m_ram_ro types, write operations will not trigger the device
>> model, and will be discarded later in __hvm_copy(); while for the
>> p2m_mmio_write_dm type pages, writes will go to the device model
>> via ioreq-server.
>>
>> Signed-off-by: Yu Zhang <yu.c.zhang@linux.intel.com>
>> Signed-off-by: Wei Ye <wei.ye@intel.com>
>
> Thanks for this -- only two comments:
>
>> @@ -5978,7 +5982,8 @@ long do_hvm_op(unsigned long op, XEN_GUEST_HANDLE_PARAM(void) arg)
>>                   goto param_fail4;
>>               }
>>               if ( !p2m_is_ram(t) &&
>> -                 (!p2m_is_hole(t) || a.hvmmem_type != HVMMEM_mmio_dm) )
>> +                 (!p2m_is_hole(t) || a.hvmmem_type != HVMMEM_mmio_dm) &&
>> +                 t != p2m_mmio_write_dm )
>
> I think that Jan already brough this up, and maybe I missed your
> answer: this realaxation looks wrong to me. I would have thought that
> transition between p2m_mmio_write_dm and p2m_ram_rw/p2m_ram_logdirty
> would be the only ones you would want to allow.

Ha. Sorry, my negligence, and thanks for pointing out. :)
The transition we use now is only between p2m_mmio_write_dm and 
p2m_ram_rw. So how about this:

     if ( !p2m_is_ram(t) &&
          (!p2m_is_hole(t) || a.hvmmem_type != HVMMEM_mmio_dm) &&
          (t != p2m_mmio_write_dm || a.hvmmem_type != HVMMEM_ram_rw) )

>
>> @@ -111,7 +112,8 @@ typedef unsigned int p2m_query_t;
>>   #define P2M_RO_TYPES (p2m_to_mask(p2m_ram_logdirty)     \
>>                         | p2m_to_mask(p2m_ram_ro)         \
>>                         | p2m_to_mask(p2m_grant_map_ro)   \
>> -                      | p2m_to_mask(p2m_ram_shared) )
>> +                      | p2m_to_mask(p2m_ram_shared)   \
>> +                      | p2m_to_mask(p2m_mmio_write_dm))
>
> Nit: please align the '\' with the others above it.
Got it, and thanks.

B.R.
Yu
>
> Cheers,
>
> Tim.
>
>

  reply	other threads:[~2014-12-05  2:00 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-12-04 13:13 [PATCH v5 0/2] add new p2m type class and new p2m type Yu Zhang
2014-12-04 13:13 ` [PATCH v5 1/2] add a new p2m type class - P2M_DISCARD_WRITE_TYPES Yu Zhang
2014-12-04 15:56   ` Tim Deegan
2014-12-04 13:13 ` [PATCH v5 2/2] add a new p2m type - p2m_mmio_write_dm Yu Zhang
2014-12-04 16:04   ` Tim Deegan
2014-12-05  2:00     ` Yu, Zhang [this message]
2014-12-05  9:42       ` Tim Deegan

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=548111CC.1070300@linux.intel.com \
    --to=yu.c.zhang@linux.intel.com \
    --cc=JBeulich@suse.com \
    --cc=Paul.Durrant@citrix.com \
    --cc=Xen-devel@lists.xen.org \
    --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=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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.