|
|
|
|
|
|
|
|
|
|
xen-devel
[Xen-devel] Query regarding x86_emulate_memop() function
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>
|
- [Xen-devel] Query regarding x86_emulate_memop() function,
Abhinav Srivastava <=
|
|
|
|
|