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

Re: [Xen-devel] How hypervisor accesses machine address





On 30/12/2009 13:25, "LIU Wei" <liuw@xxxxxxxxx> wrote:

> 
> So, I do following experiment. All operations are done in the
> hypervisor, in a hypercall written by myself:
> 
> 1. provide a mfn, denoted as maddr, which refers to a machine frame of
>    an running domain.

First of all, an mfn is not the same as a maddr. An mfn represents a range
of maddrs, in the range mfn<<PAGE_SHIFT to (mfn<<PAGE_SHIFT)+PAGE_SIZE-1.
Basically you need to shift an mfn left by PAGE_SHIFT before passing to
__va().

> 2. calculate vaddr=__va(maddr) .

Secondly, only 64-bit hypervisor has all memory mapped all the time. If you
are running a 32-bit hypervisor then you have to use
map_domain_page()/unmap_domain_page() interfaces to dynamically map/unmap
arbitrary memory pages.

 -- Keir

> 3. access this page through vaddr.



_______________________________________________
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®.