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

[Xen-devel] Query regarding x86_emulate_memop() function

To: xen-devel@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-devel] Query regarding x86_emulate_memop() function
From: Abhinav Srivastava <abhinavs_iitkgp@xxxxxxxxxxx>
Date: Fri, 6 Jun 2008 22:38:22 +0530 (IST)
Delivery-date: Fri, 06 Jun 2008 10:08:49 -0700
Domainkey-signature: a=rsa-sha1; q=dns; c=nofws; s=s1024; d=yahoo.co.in; h=Received:X-Mailer:Date:From:Subject:To:MIME-Version:Content-Type:Content-Transfer-Encoding:Message-ID; b=aYGvE/9oIjFwz+h4s5wI+KKUPgRcFOvFPk9+SANzttl2VekEGPbR6Ce0rA2gKMp/ibEafO/giFrDByxmsfVykUaHNVZYQXoTSUgYSiU69PHBv3kdhZjI92Yo1gHY2zs5M7Zsbduv0Vl12t0xDwWXSus5elfSoIZrZLeGyZ+wJ/I=;
Envelope-to: www-data@xxxxxxxxxxxxxxxxxx
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/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
Hi there,

I have a question regarding the functionality of x86_emulate_memop (Xen 3.1) or 
x86_emulate (Xen 3.2) function. This function gets called from sh_page_fault() 
function which is invoked when Xen receives a page fault.

Since I am not clear completely about the emulation operation performed by Xen, 
I have following questions with a below mentioned scenario?

1) Suppose I have a memory location that I need to protect it from being 
written by a guest OS. Since a page table protection works at a page level, we 
have to mark that complete page read-only inside the shadow page table. So, 
whenever a guest tries to write on that page, writes are propagated to shadow 
page table. Due to read only page this would create a page-fault and 
sh_page_fault code would be invoked. In the sh_page_fault code, we can check 
whether on this page the memory location which is being written (using CR2 
register) is protected or not. If not, my goal is to let this operation go 
through. And, I heard here this emulation thing comes into the picture.

After checking and deciding this operation should go through, i call "goto 
emulate" from sh_page_fault code assuming it would emulate that operation and 
update the eip to the next instruction.

Question: Is this understanding correct? The reason why I am asking is that 
since page is write-protected, it means while emulating it should again fault. 
Then, how does this emulation work? And, what is the use of this function? In 
what context it should be used and in what context it is invoked from 
sh_page_fault().

And, if I have to achieve above-mentioned (scenario) functionality which part 
of the code I should lookinto/change to achieve that.

I would really appreciate if some could explain me this.

Thanks,
Abhinav




      Bring your gang together. Do your thing. Find your favourite Yahoo! group 
at http://in.promos.yahoo.com/groups/

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

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