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] Re: xc_translate_foreign_address() returns mfn??

To: "List: Xen Developers" <xen-devel@xxxxxxxxxxxxxxxxxxx>
Subject: [Xen-devel] Re: xc_translate_foreign_address() returns mfn??
From: "Jun Koi" <junkoi2004@xxxxxxxxx>
Date: Fri, 19 Dec 2008 23:38:02 +0900
Delivery-date: Fri, 19 Dec 2008 06:38:27 -0800
Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from:to :subject:in-reply-to:mime-version:content-type :content-transfer-encoding:content-disposition:references; bh=4zSaTU5azqsnCh9uefSVUnCFeocQP5iNI7mMyy+9s2c=; b=tTQGRrzKlbxTjBZ7zWzc/1PhGiOVHyQY2vb3X+fCvbTiE6w9BQg3E1L6FUtUwMGkLY 9sElYelhjg2Efpw7M9CC+2Eg0Pc6YPIMuox22w9lkwg+e/8os7VJGgydQD7io39Mt7OF tebJy0R0AIbL5YWlIrxZOlxGLgvje1cOkplgw=
Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:to:subject:in-reply-to:mime-version :content-type:content-transfer-encoding:content-disposition :references; b=nBpIfSYg497IgWfkVDeQqGZ+umc08TDhx+s6vpa2aJM8w5wQi65zOTXT44Co0bCxV1 fq9W4nGZXOl+LCiKRAuS0SBmnDBVcyeprC/s+S+zXYrq91q6lrHh8d5jxrzQbPL51fqQ d1S5I5HajeOBs2/YqoYiRtA5ql+sTDzn0pywM=
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
In-reply-to: <fdaac4d50812190216p398a615ds92cdf95197d84590@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>
References: <fdaac4d50812190216p398a615ds92cdf95197d84590@xxxxxxxxxxxxxx>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
On Fri, Dec 19, 2008 at 7:16 PM, Jun Koi <junkoi2004@xxxxxxxxx> wrote:
> Hi,
>
> I looked at the function xc_translate_foreign_address(), and see that
> it walks the page table of the guest VM. So at best, it should return
> the pfn of the guest (?)
>
> We can see taht the Later part of the function is like this:
> ...
>        if (pt_levels >= 3)
>            mfn = (pte & L0_PAGETABLE_MASK_PAE) >> PAGE_SHIFT;
>        else
>            mfn = (pte & L0_PAGETABLE_MASK) >> PAGE_SHIFT;
> ..
> return mfn;
>
> So perhaps I miss something, but the "mfn" here should be "pfn", so
> this function should return pfn, not mfn as in the comment of
> xenctrl.h.
>
> This makes me very confused now.

So everything indicates that xc_translate_foreign_address() actually
returns gfn, not mfn like in its comment. Could anybody confirms that
the function works well on both PV and HVM?

And I think xc_map_foreign_range() actually works with gfn, not mfn.
Does it work with both PV and HVM, too?

Thanks,
Jun

_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel