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

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

To: Jun Koi <junkoi2004@xxxxxxxxx>
Subject: Re: [Xen-devel] Re: xc_translate_foreign_address() returns mfn??
From: Tim Deegan <Tim.Deegan@xxxxxxxxxx>
Date: Fri, 19 Dec 2008 17:13:12 +0000
Cc: "List: Xen Developers" <xen-devel@xxxxxxxxxxxxxxxxxxx>
Delivery-date: Fri, 19 Dec 2008 09:13:51 -0800
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
In-reply-to: <fdaac4d50812190638j7ad2633av58426147b63236d0@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> <fdaac4d50812190638j7ad2633av58426147b63236d0@xxxxxxxxxxxxxx>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
User-agent: Mutt/1.5.17 (2007-11-01)
Hi,

At 23:38 +0900 on 19 Dec (1229729882), Jun Koi wrote:
> 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?

To the best of my knowledge that function does not work at all for HVM
(at least, I know it is broken when using 32-bit tools and 64-bit xen).
I have a half-done patchset that cleans it up considerably, fixing HVM
and compat issues, which I'll probably post at the end of the month.

In any case, you are right: these functions (like _almost_ every other
interface dealing with guest memory) deals in what in the shadow code are
called GFNs.  That is, untranslated GPFNs for HVM guests, and MFNs for PV.

The use of "mfn" in the source code is probably an indicator that this
code pre-dates HVM guest support.

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

Yes indeed!  Lots of other things rely on it (qemu-dm, save/restore, etc).

Cheers,

Tim.

-- 
Tim Deegan <Tim.Deegan@xxxxxxxxxx>
Principal Software Engineer, Citrix Systems (R&D) Ltd.
[Company #02300071, SL9 0DZ, UK.]

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