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

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

To: LIU Wei <liuw@xxxxxxxxx>, "xen-devel@xxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxx>
Subject: Re: [Xen-devel] How hypervisor accesses machine address
From: Keir Fraser <keir.fraser@xxxxxxxxxxxxx>
Date: Wed, 30 Dec 2009 13:40:35 +0000
Cc:
Delivery-date: Wed, 30 Dec 2009 05:41:42 -0800
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
In-reply-to: <d6a64190912300525s2dddce5akbf06004c436c9046@xxxxxxxxxxxxxx>
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/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
Thread-index: AcqJU68uMNBSoUtLQ/m3t3eZBzdKBgAAfrG+
Thread-topic: [Xen-devel] How hypervisor accesses machine address
User-agent: Microsoft-Entourage/12.23.0.091001


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

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