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

[Xen-devel] How to convert from virtual to machine address (any macros?)

To: xen-devel@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-devel] How to convert from virtual to machine address (any macros?)
From: "Joana M. F. Trindade" <jmftrindade@xxxxxxxxx>
Date: Mon, 23 Feb 2009 20:34:44 -0600
Delivery-date: Mon, 23 Feb 2009 18:35:10 -0800
Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:date:message-id:subject :from:to:content-type; bh=LY9V6WoYrmuLF4pQl5y+wzhLhHarTJd+/d2gWkAU2M8=; b=U7EVj3MjCrrrotKawB1AgsxAB56JV38umJbL+TTWqi2xGPnXk6dEvBFhLpNyQRQXPb 32CaREe7fJW5L8gdEMOe8RdheoFHpWkhEM3cjtuE2aasiy/l9Gesrb1GB4Wi/eHKzMT4 icMIeYbl2fVA80m0D5qlortz6lBEK72ERI2+o=
Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:date:message-id:subject:from:to:content-type; b=XJQU93TUKBhvyCKEPfm5fPWIT5DrGO19HEVMJ9/eMoNTzDTzlX7VVVykf8WeMtVlJx 34PbWrGeSHkp1hhGOQdD9RETCrPF5l44Ug4Px/hQO6Ep1pwXHX7R5nlko+/7SFbmLZaj fqSvtDZm5v4C6NnH3S4NXPH2U+BGY3ffhKoDg=
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
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
Hi,

I browsed the archives, but could not find an example on this. What are the macros for converting a virtual address to machine address on Xen in x86 architectures?

For example, on a non-virtualized dom0, the following code works:

static int virt_to_phys (struct task_struct *p, unsigned long addr) {
   // (...)
   ret = get_user_pages (p, p->mm, addr, 1, 1, 1, &page, &vma);
   if (ret <= 0) {
      // do something
   }
   offset = addr & (PAGE_SIZE - 1);
   maddr = kmap (page);
   return (int) maddr + offset;
}

However, this mapping seems incorrect on the same dom0 on top of Xen. Therefore, I would like to know if there's an example (or pointers to macros) on how to do the virtual->pseudo-physical->machine address mapping on Xen.

Thanks and regards,
Joana

--
Joana M. F. da Trindade
Visiting Scholar
Center for Reliable and High-Performance Computing
University of Illinois at Urbana-Champaign

Personal Homepage: http://joanatrindade.wikidot.com
LinkedIn: http://www.linkedin.com/in/joanatrindade
_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel
<Prev in Thread] Current Thread [Next in Thread>
  • [Xen-devel] How to convert from virtual to machine address (any macros?), Joana M. F. Trindade <=