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

To: Gianni Tedesco <gianni.tedesco@xxxxxxxxxx>
Subject: RE: [Xen-devel] VCPU Structure
From: "Nimgaonkar, Satyajeet" <SatyajeetNimgaonkar@xxxxxxxxxx>
Date: Tue, 16 Nov 2010 18:37:16 +0000
Accept-language: en-US
Cc: Kaushik Barde <kbarde@xxxxxxxxxx>, Xen Devel <xen-devel@xxxxxxxxxxxxxxxxxxx>
Delivery-date: Tue, 16 Nov 2010 10:40:57 -0800
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
In-reply-to: <1289584801.22729.190.camel@xxxxxxxxxxxxxxxxxxxxxx>
List-help: <mailto:xen-devel-request@lists.xensource.com?subject=help>
List-id: Xen developer discussion <xen-devel.lists.xensource.com>
List-post: <mailto:xen-devel@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe>
References: <fa86f3a6-2433-4595-b249-a10711cb44da@default> , <007601cb81f2$5f7e90f0$1e7bb2d0$@com> <12871952FC0E29439F861FA745BCDD8503ECA8D8@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx>, <1289584801.22729.190.camel@xxxxxxxxxxxxxxxxxxxxxx>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
Thread-index: AQHLfIhrBFMS+6m2GUqlA/EV1FAQmJNnDLvlgACP1gCABU8bAIABO4jTgAAGlYCABlO7LA==
Thread-topic: [Xen-devel] VCPU Structure
Hi Gianni,
               Thanks for your reply. I would certainly prefer to lock the 
pages instead. I checked the source code and in libxc/xc_domain.c, I see some 
code on locking the pages for a hypercall. I my case too, i need to lock memory 
pages assigned to a hypercall. Is that a right place I am looking at or can you 
please redirect me some code samples about locking memory pages.
               Thanks once again.

Regards,
Satyajeet
________________________________________
From: Gianni Tedesco [gianni.tedesco@xxxxxxxxxx]
Sent: Friday, November 12, 2010 12:00 PM
To: Nimgaonkar, Satyajeet
Cc: Kaushik Barde; Xen Devel
Subject: 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>