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/
Home Products Support Community News


RE: [Xen-devel] Dom heap virtual address question

To: "Tian, Kevin" <kevin.tian@xxxxxxxxx>, "Xen-Devel (E-mail)" <xen-devel@xxxxxxxxxxxxxxxxxxx>
Subject: RE: [Xen-devel] Dom heap virtual address question
From: Daniel Magenheimer <dan.magenheimer@xxxxxxxxxx>
Date: Tue, 26 Aug 2008 18:19:45 -0700 (PDT)
Delivery-date: Tue, 26 Aug 2008 18:20:26 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
In-reply-to: <D470B4E54465E3469E2ABBC5AFAC390F024D96E6@xxxxxxxxxxxxxxxxxxxxxxxxxxxx>
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 Kevin --

Thanks much for the reply.

Further clarification on the _global versions:
If domainA makes a hypercall that results in the

va = mfn_to_virt(page_to_mfn(alloc_domheap_pages()))

(or equivalent wrapped in map/unmap_domain_page)

and then domainB makes a hypercall but IN THE
HYPERVISOR I want to make use of the previously
saved va (or mapped mfn), is that still in the context
of domainA?  In other words, I must use _global?


> -----Original Message-----
> From: Tian, Kevin [mailto:kevin.tian@xxxxxxxxx]
> Sent: Tuesday, August 26, 2008 6:35 PM
> To: Daniel Magenheimer; Xen-Devel (E-mail)
> Subject: RE: [Xen-devel] Dom heap virtual address question
> >From: Daniel Magenheimer
> >Sent: 2008年8月27日 7:49
> >
> >Silly x86-related memory question from someone who has only
> >used global virtual address machines for too many years:
> >
> >Is it possible to take the result of an alloc_domheap_pages()
> >(struct page_info *) and convert this to a virtual address
> >that can be used at a later time in the hypervisor (not
> >in a domain)?  E.g.
> >
> >va = mfn_to_virt(page_to_mfn(alloc_domheap_pages()))
> >  :
> >(many seconds later, still in hypervisor)
> >  :
> >a = *(unsigned int *)va;
> This only applies to 64bit xen which directly maps all memory
> in a large enough virtual address range. For 32bit xen, mfn_to_virt
> only applies to xenheap pages.
> >
> >Or is it necessary to do a va = map_domain_page(mfn)
> >then unmap_domain_page(va) around each usage?  (And
> >if so do I need the _global version of these?)
> map/unmap_domain_page is cleaner wrap, suitable for both
> 32bit and 64bit xen. For 64bit xen, it's actually a macro to
> mfn_to_virt and thus map/unmap is light. you can use _global
> version if you'd like to access that page from any domain
> context and don't want to local map/unmap frequently.
> Thanks,
> Kevin
> _______________________________________________
> Xen-devel mailing list
> Xen-devel@xxxxxxxxxxxxxxxxxxx
> http://lists.xensource.com/xen-devel

Xen-devel mailing list

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