xen-devel.lists.xenproject.org archive mirror
 help / color / mirror / Atom feed
* Is this a data corruption bug for p2m_ram_shared page in hvm_hap_nested_page_fault()
@ 2012-02-02 10:17 nai.xia
  2012-02-02 10:25 ` nai.xia
  0 siblings, 1 reply; 4+ messages in thread
From: nai.xia @ 2012-02-02 10:17 UTC (permalink / raw)
  To: Joe Epstein; +Cc: xen-devel, Keir Fraser, Tim Deegan

Hi,

In hvm_hap_nested_page_fault(), it seems that all valid write faults are now handled
by p2m_mem_access_check(), right? Then when will mem_sharing_unshare_page()
be called? And if p2m->access_required == false, the access restrictions is cleared
, then the data in this shared page could be corrupted by this page write access?


Thanks,

Nai

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Is this a data corruption bug for p2m_ram_shared page in hvm_hap_nested_page_fault()
  2012-02-02 10:17 Is this a data corruption bug for p2m_ram_shared page in hvm_hap_nested_page_fault() nai.xia
@ 2012-02-02 10:25 ` nai.xia
  2012-02-02 11:19   ` Tim Deegan
  0 siblings, 1 reply; 4+ messages in thread
From: nai.xia @ 2012-02-02 10:25 UTC (permalink / raw)
  To: Joe Epstein; +Cc: xen-devel, Keir Fraser, Tim Deegan



On 2012年02月02日 18:17, nai.xia wrote:
> Hi,
>
> In hvm_hap_nested_page_fault(), it seems that all valid write faults are now handled
> by p2m_mem_access_check(), right? Then when will mem_sharing_unshare_page()
> be called? And if p2m->access_required == false, the access restrictions is cleared

Oh, sorry, I notice that with p2m_ram_shared, the write permissions is always cleared.
But, still, this seems cannot lead to the call of mem_sharing_unshare_page() and this
write fault will happen again and again?


Thanks,

Nai


> , then the data in this shared page could be corrupted by this page write access?
>
>
> Thanks,
>
> Nai

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xensource.com
http://lists.xensource.com/xen-devel

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Is this a data corruption bug for p2m_ram_shared page in hvm_hap_nested_page_fault()
  2012-02-02 10:25 ` nai.xia
@ 2012-02-02 11:19   ` Tim Deegan
  2012-02-02 11:48     ` nai.xia
  0 siblings, 1 reply; 4+ messages in thread
From: Tim Deegan @ 2012-02-02 11:19 UTC (permalink / raw)
  To: nai.xia; +Cc: Joe Epstein, xen-devel, Keir Fraser, Tim Deegan

At 18:25 +0800 on 02 Feb (1328207143), nai.xia wrote:
> On 2012???02???02??? 18:17, nai.xia wrote:
> >In hvm_hap_nested_page_fault(), it seems that all valid write faults are 
> >now handled
> >by p2m_mem_access_check(), right? Then when will mem_sharing_unshare_page()
> >be called? And if p2m->access_required == false, the access restrictions 
> >is cleared
> 
> Oh, sorry, I notice that with p2m_ram_shared, the write permissions is
> always cleared.  But, still, this seems cannot lead to the call of
> mem_sharing_unshare_page() and this write fault will happen again and
> again?

There's an explicit call of mem_sharing_unshare_page() in
hvm_hap_nested_page_fault(); the only thing that will skip that is if
the fault is caused by a p2m_access violation, in which case 
we report the fault on the p2m_access ring and wait for the consumer of
that ring to fix the problem. 

Cheers,

Tim.

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Is this a data corruption bug for p2m_ram_shared page in hvm_hap_nested_page_fault()
  2012-02-02 11:19   ` Tim Deegan
@ 2012-02-02 11:48     ` nai.xia
  0 siblings, 0 replies; 4+ messages in thread
From: nai.xia @ 2012-02-02 11:48 UTC (permalink / raw)
  To: Tim Deegan; +Cc: Joe Epstein, xen-devel, Keir Fraser, Tim Deegan



On 2012年02月02日 19:19, Tim Deegan wrote:
> At 18:25 +0800 on 02 Feb (1328207143), nai.xia wrote:
>> On 2012???02???02??? 18:17, nai.xia wrote:
>>> In hvm_hap_nested_page_fault(), it seems that all valid write faults are
>>> now handled
>>> by p2m_mem_access_check(), right? Then when will mem_sharing_unshare_page()
>>> be called? And if p2m->access_required == false, the access restrictions
>>> is cleared
>>
>> Oh, sorry, I notice that with p2m_ram_shared, the write permissions is
>> always cleared.  But, still, this seems cannot lead to the call of
>> mem_sharing_unshare_page() and this write fault will happen again and
>> again?
>
> There's an explicit call of mem_sharing_unshare_page() in
> hvm_hap_nested_page_fault(); the only thing that will skip that is if
> the fault is caused by a p2m_access violation, in which case
> we report the fault on the p2m_access ring and wait for the consumer of
> that ring to fix the problem.

Oh, yes! I was mistaken that the write flag of p2m_access would also be
removed for p2m_ram_shared pages just like entry->w in ept_set_entry().
I am clear about the role of the p2m_access_t now.

Thanks for the reply! :)


Regards,

Nai

>
> Cheers,
>
> Tim.

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xensource.com
http://lists.xensource.com/xen-devel

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2012-02-02 11:48 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-02-02 10:17 Is this a data corruption bug for p2m_ram_shared page in hvm_hap_nested_page_fault() nai.xia
2012-02-02 10:25 ` nai.xia
2012-02-02 11:19   ` Tim Deegan
2012-02-02 11:48     ` nai.xia

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