From: Keir Fraser Subject: Re: How hypervisor accesses machine address Date: Wed, 30 Dec 2009 13:40:35 +0000 Message-ID: References: Mime-Version: 1.0 Content-Type: text/plain; charset="US-ASCII" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com To: LIU Wei , "xen-devel@lists.xensource.com" List-Id: xen-devel@lists.xenproject.org On 30/12/2009 13:25, "LIU Wei" 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< 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.