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


[Xen-devel] guest physical to xen machine copy?

To: "Xen-Devel (E-mail)" <xen-devel@xxxxxxxxxxxxxxxxxxx>
Subject: [Xen-devel] guest physical to xen machine copy?
From: Dan Magenheimer <dan.magenheimer@xxxxxxxxxx>
Date: Sat, 27 Sep 2008 14:33:04 -0700 (PDT)
Delivery-date: Sat, 27 Sep 2008 14:34:52 -0700
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
Sorry for my poor x86 memory model knowlege...

In some code I am working on, I currently pass the
address of a guest page from a domain via a hypercall
and in Xen either copy to or from the guest page

__copy_from_guest(xen_va, guest_va, PAGE_SIZE)


__copy_to_guest(guest_va, xen_va, PAGE_SIZE)

where guest_va is declared as a XEN_GUEST_HANDLE(void)

Now I'd like to switch the hypercall interface so
that the domain passes a guest physical address
(or guest physical frame number) instead of a guest
virtual address.

I see code that does get_gpfn_from_mfn() but not
the opposite.  What do I need to do to copy a
page of data from a guest pfn to a Xen mfn (or
vice versa)?  And is a guest physical address
still referenced as a XEN_GUEST_HANDLE?

It's probably very simple but I can't find it...


P.S. This has to work on 32- or 64-bit guests to
both 32- and 64-bit hypervisors.

Xen-devel mailing list