[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] RE: [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
|
Lists.xenproject.org is hosted with RackSpace, monitoring our |