WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-devel

RE: [Xen-devel] VCPU Structure

On Fri, 2010-11-12 at 17:43 +0000, Nimgaonkar, Satyajeet wrote:
> Hi Kaushik, 
>                  Here is what I wish to do.
>                  I have implemented a custom hypercall in xen. Now i
> need to access the memory pages that are being assigned to a
> particular process. I intend to do this from the hypercall handler
> itself. Once I have these memory pages, I will compute the hash
> (Memory Integrity block) of it and store it in the VCPU structure.
> This will help me save the state of the memory for a particular
> process. Later I can check if some modification have been done to the
> process by computing and matching the hash value with the one saved in
> the VCPU.
>                 It would be great if you could give me some insight on
> how to achieve this. Any sample code or examples on this would help a
> lot. 
>                 Thanks a lot.

One way would be to use the MMU, you can mark those pages read-only in
the page table and then you will get a pagefault for any write to such a
page. In the fault handler you would mark the page as modified and
unprotect it by setting it read/write again.

That would save a lot of time doing expensive calculations when you
could just use the existing hardware acceleration designed for exactly
this purpose.

See Volume 3, Chapter 4 of the Intel architecture software developers
manual.

Gianni


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

<Prev in Thread] Current Thread [Next in Thread>