[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Xen-devel] Translate virtual address to physical address



On Sat, 2011-12-31 at 21:52 +0000, lmingcsce wrote:
> Hi everyone, I'm working on a research project now and encounter a problem
> like this:
> I establish a new array in the tools directory and pass the address of this
> array to the hypervisor. I want to know how can I translate the virtual
> address of the array to the machine address. In this way, the hypervisor can
> modify the values in this array. 
> Thanks for your help. 
> 

Establishing a new array in the tools *directory*? I presume the
"directory" is superfluous.

You can take a look at some hypercall implementations, e.g. multicall.
Example code can be found at xc_minios.c:minios_privcmd_hypercall and
multicall.c:do_multicall .

One thing I want to remind you is that you don't have to translate
virtual address to machine address before passing it to hypervisor.
copy_from_guest can handle that for you. But you do need to define
GUEST_HANDLE for your hypercall. (Again, check multicall implementation
for details.)


Wei.


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


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.