[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-devel] Re: xc_translate_foreign_address() returns mfn??


  • To: "List: Xen Developers" <xen-devel@xxxxxxxxxxxxxxxxxxx>
  • From: "Jun Koi" <junkoi2004@xxxxxxxxx>
  • Date: Fri, 19 Dec 2008 23:38:02 +0900
  • Delivery-date: Fri, 19 Dec 2008 06:38:27 -0800
  • 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=
  • List-id: Xen developer discussion <xen-devel.lists.xensource.com>

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


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.