On Jun 24, 2016 05:19, "Razvan Cojocaru" <rcojoc...@bitdefender.com> wrote:
>
> On 06/24/2016 02:05 PM, George Dunlap wrote:
> > On Wed, Jun 22, 2016 at 12:38 PM, sepanta s <sapanta...@gmail.com>
wrote:
> >> Hi,
> >> Is it possible to monitor the access on the pages withp2m_type_t
> >> p2m_ram_shared?
> >
> > cc'ing Tamas and Razvan
>
> Thanks for the CC. Judging by the "if ( npfec.write_access && (p2mt ==
> p2m_ram_shared) )" line in hvm_hap_nested_page_fault() (from
> xen/arch/x86/hvm/hvm.c), I'd say it certainly looks possible. But I
> don't know what the context of the question is.
>
>
> Thanks,
> Razvan

Yes, p2m_ram_shared type pages can be monitored with mem_access just as
normal pages. The only part that may be tricky is if you map the page into
your monitoring application while the page is shared. Your handle will
continue to be valid even if the page is unshared but it will continue to
point to the shared page. However, even if you catch write access events to
the shared page that will lead to unsharing, the mem_access notification is
sent before unsharing. I just usually do unsharing myself in the mem_access
callback manually for monitored pages for this reason. I might change the
flow in 4.8 to send the notification after the unsharing happened to
simplify this.

Tamas
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

Reply via email to